<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>Log4Net使用指南 - 摩诘 - 博客园</title>
<meta name="keywords" content="技术研究,Log4Net使用指南">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/dragon/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/dragon/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head><body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        
<div id="top">
	
<div>
	<table>
		<tbody><tr>
			<td class="HeaderTitles">
				<h1 class="HeaderTitle"><a id="Header1_HeaderTitle" class="HeaderMainTitle" href="http://www.cnblogs.com/dragon/">摩诘</a></h1>
				<p id="tagline">我思故我在 常辨而常新</p>
			</td>
		</tr>
	</tbody></table>
</div>
<div class="HeaderBar">
	<table id="HeaderBar" class="HeaderBar" cellpadding="0" cellspacing="0">
		<tbody><tr>
			<td class="HeaderBarTab" nowrap="nowrap">
&nbsp;
<a id="Header1_MyLinks1_HomeLink" href="http://www.cnblogs.com/">博客园</a>&nbsp;::
<a id="Header1_MyLinks1_MyHomeLink" href="http://www.cnblogs.com/dragon/">首页</a>&nbsp;::
<a id="Header1_MyLinks1_NewPostLink" href="http://www.cnblogs.com/dragon/admin/EditPosts.aspx?opt=1">新随笔</a>&nbsp;::
<a id="Header1_MyLinks1_ContactLink" accesskey="9" href="http://space.cnblogs.com/msg/send/sema">联系</a>&nbsp;::
<a id="Header1_MyLinks1_Syndication" href="http://www.cnblogs.com/dragon/rss">订阅</a>
<a id="Header1_MyLinks1_XMLLink" class="XMLLink" href="http://www.cnblogs.com/dragon/rss"><img src="xml.gif" alt="订阅" style="border-width: 0px;"></a>&nbsp;::
<a id="Header1_MyLinks1_Admin" href="http://www.cnblogs.com/dragon/admin/EditPosts.aspx">管理</a>&nbsp;::

</td>
			<td><img id="Header1_BlueTab" src="bluetabright.gif" style="border-width: 0px;" align="absmiddle"></td>
			<td class="HeaderBarTabBack" nowrap="nowrap" width="100%">
				
<div class="BlogStatsBar">
	<table class="BlogStatsBar">
		<tbody><tr>
			<td width="100%">
			</td>
			<td class="BlogStatsBar" nowrap="nowrap">
				&nbsp;
				20 
				随笔&nbsp;::
				2 文章
				::
				383 评论
				::
				14 引用
			</td>
		</tr>
	</tbody></table>
</div>

			</td>
		</tr>
	</tbody></table>
</div>

</div>
<div id="leftmenu">

	    <table id="Calendar1_entryCal" class="Cal" title="Calendar" style="border-style: solid; border-width: 1px; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr><td colspan="7" style="background-color: Silver;"><table class="CalTitle" style="width: 100%; border-collapse: collapse;" border="0" cellspacing="0">
		<tbody><tr><td class="CalNextPrev" style="width: 15%;"><a href="javascript:__doPostBack('Calendar1$entryCal','V3622')" style="color: Black;" title="Go to the previous month">&lt;</a></td><td style="width: 70%;" align="center">2010年1月</td><td class="CalNextPrev" style="width: 15%;" align="right"><a href="javascript:__doPostBack('Calendar1$entryCal','V3684')" style="color: Black;" title="Go to the next month">&gt;</a></td></tr>
	</tbody></table></td></tr><tr><th class="CalDayHeader" abbr="日" scope="col" align="center">日</th><th class="CalDayHeader" abbr="一" scope="col" align="center">一</th><th class="CalDayHeader" abbr="二" scope="col" align="center">二</th><th class="CalDayHeader" abbr="三" scope="col" align="center">三</th><th class="CalDayHeader" abbr="四" scope="col" align="center">四</th><th class="CalDayHeader" abbr="五" scope="col" align="center">五</th><th class="CalDayHeader" abbr="六" scope="col" align="center">六</th></tr><tr><td class="CalOtherMonthDay" style="width: 14%;" align="center">27</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">28</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">29</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">30</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">31</td><td style="width: 14%;" align="center">1</td><td class="CalWeekendDay" style="width: 14%;" align="center">2</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">3</td><td style="width: 14%;" align="center">4</td><td style="width: 14%;" align="center">5</td><td style="width: 14%;" align="center">6</td><td style="width: 14%;" align="center">7</td><td style="width: 14%;" align="center">8</td><td class="CalWeekendDay" style="width: 14%;" align="center">9</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">10</td><td style="width: 14%;" align="center">11</td><td style="width: 14%;" align="center">12</td><td style="width: 14%;" align="center">13</td><td style="width: 14%;" align="center">14</td><td style="width: 14%;" align="center">15</td><td class="CalTodayDay" style="width: 14%;" align="center">16</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">17</td><td style="width: 14%;" align="center">18</td><td style="width: 14%;" align="center">19</td><td style="width: 14%;" align="center">20</td><td style="width: 14%;" align="center">21</td><td style="width: 14%;" align="center">22</td><td class="CalWeekendDay" style="width: 14%;" align="center">23</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">24</td><td style="width: 14%;" align="center">25</td><td style="width: 14%;" align="center">26</td><td style="width: 14%;" align="center">27</td><td style="width: 14%;" align="center">28</td><td style="width: 14%;" align="center">29</td><td class="CalWeekendDay" style="width: 14%;" align="center">30</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">31</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">1</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">2</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">3</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">4</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">5</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">6</td></tr>
</tbody></table>

		
<h3>公告</h3>
<div class="News">
	<!--img src="http://www.cnblogs.com/Files/dragon/Dragon.zip" width=300 height=225 border=0 -->
<br>
要对我的朋友们说抱歉了,因为去年转向从事SAP的技术,所以很少有精力写.NET的新文章和回答朋友们的问题了。希望以后还能慢慢再写一些!
<br>
被访问次数：
<br>


<a href="http://freelogs.com/stats/d/dragonluo/" target="_top"><img alt="Free Web Counter" src="index.php" align="middle" border="0" hspace="4" vspace="2"></a>
<br>

<br>
访客人数：
<br>
<a href="http://freelogs.com/stats/d/dragonluouser/" target="_top"><img alt="Free Web Counter" src="index_001.php" align="middle" border="0" hspace="4" vspace="2"></a>
<br><div id="profile_block"><a href="http://home.cnblogs.com/dragon/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/dragon/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/dragon/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/sema" target="_top">发短消息</a></div>
</div>

		

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<div class="ad_side">
<ul style="margin-left: 0px;"><li>
<div>

<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 150px; position: relative; visibility: visible; width: 180px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 150px; position: relative; visibility: visible; width: 180px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame4" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_1.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="150" width="180"></iframe></ins></ins>
</div></li></ul>
</div>
<h3>常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/dragon/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl01_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/dragon/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/dragon/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl04_lnkLinkItem" href="http://www.cnblogs.com/dragon/tag/">我的标签</a></li>
	</ul>
</div>
<h3 class="catListTitle">我参与的团队</h3>
<div class="RecentComment">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1__1daaec0_TeamList_ctl01_lnkTeam" href="http://team.cnblogs.com/SHDotNetClub/">上海.NET俱乐部(0/0)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1daaec0_TeamList_ctl02_lnkTeam" href="http://team.cnblogs.com/BluePrint/">BluePrint翻译团队(0/0)</a>
			</li>
		
			</ul>
		
</div>


<h3 class="catListTitle">我的标签</h3>
<div id="MyTag">
<ul>
<li><a href="http://www.cnblogs.com/dragon/tag/%e5%a4%9a%e6%ac%a1%e8%a7%a6%e5%8f%91/">多次触发</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/FileSystemWatcher/">FileSystemWatcher</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/Timer/">Timer</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/Multipul/">Multipul</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/log4net/">log4net</a>(1)</li>
</ul>
</div>
		<h3>随笔分类<span style="font-size: 11px; font-weight: normal;">(20)</span></h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/category/11625.html">技术研究(17)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to 技术研究(17)" href="http://www.cnblogs.com/dragon/category/11625.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/category/11624.html">生活手记</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to 生活手记" href="http://www.cnblogs.com/dragon/category/11624.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/dragon/category/11651.html">似水流年(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to 似水流年(3)" href="http://www.cnblogs.com/dragon/category/11651.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/dragon/category/11626.html">小说收藏</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to 小说收藏" href="http://www.cnblogs.com/dragon/category/11626.html/rss">(rss)</a></li>
			
				</ul>
			
	
		<h3>随笔档案<span style="font-size: 11px; font-weight: normal;">(20)</span></h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/archive/2008/07.html">2008年7月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/archive/2007/06.html">2007年6月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/dragon/archive/2006/09.html">2006年9月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/dragon/archive/2006/05.html">2006年5月 (2)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/dragon/archive/2005/07.html">2005年7月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/dragon/archive/2005/06.html">2005年6月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/dragon/archive/2005/04.html">2005年4月 (2)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/dragon/archive/2005/03.html">2005年3月 (6)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/dragon/archive/2004/10.html">2004年10月 (5)</a> </li>
			
				</ul>
			
	
		<h3>相册</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/gallery/47395.html">123</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/gallery/28706.html">life</a> </li>
			
				</ul>
			
	
		<h3>技术站点</h3>
		
				<ul>
			
				</ul>
			
	
		<h3>朋友的blog</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl01_Link" href="http://www.cnblogs.com/debbie">Debbie's blog </a> </li>
			
				</ul>
			
	
		<h3>收藏的站点</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl01_Link" href="http://dragonluo.spaces.live.com/" target="_top">我的生活</a> </li>
			<li style="margin-top: 2px;">记述我的工作及生活感受</li>
				</ul>
			
	

<h3>积分与排名</h3>
<ul>
	<li>
		积分 -
		242081
	</li><li>
		排名 -
		213
	</li>
</ul>

<h3 class="catListTitle">最新评论
	<a id="SingleColumn1__a835fb_RSSHyperlink1" href="http://www.cnblogs.com/dragon/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3>
<div class="RecentComment" id="RecentComments">
	
			<ul>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/04/11/135617.html#1718048">1.&nbsp;Re:在C#中利用自动化模型操纵Word</a>
			</li>
			<li style="">
				谢谢
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--吉文</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1700959">2.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				写得很好
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--eking</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694547">3.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				地方告诉对方公司的股份大幅vxcv
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694545">4.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				和很多黄金时代刻录机撒旦克里夫回家啊都是
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694543">5.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				抽刀断水水更流
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">阅读排行榜</h3>
<div class="RecentComment" id="TopViewPosts"> 
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/08/394078.html">1.&nbsp;深入浅出之正则表达式（一）(73020)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html">2.&nbsp;Log4Net使用指南(38494)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/09/394923.html">3.&nbsp;深入浅出之正则表达式（二）(26009)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html">4.&nbsp;自动向网页Post信息并提取返回的信息(14598)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/25/125533.html">5.&nbsp;VS.NET 2003集成环境插件开发指南(一)----操纵菜单(12639)</a>
			</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">评论排行榜</h3>
<div class="RecentComment" id="TopCommentsPosts">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html">1.&nbsp;Log4Net使用指南(89)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/08/394078.html">2.&nbsp;深入浅出之正则表达式（一）(54)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html">3.&nbsp;自动向网页Post信息并提取返回的信息(45)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/07/29/203189.html">4.&nbsp;在.NET环境中实现每日构建(Daily Build)--NAnt篇(38)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/09/394923.html">5.&nbsp;深入浅出之正则表达式（二）(32)</a>
			</li>
		
			</ul>
		
</div>
		
</div>
<div id="main">
	
					
<div class="post">
	<div class="postTitle">
		<a id="ctl03_TitleUrl" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html">Log4Net使用指南</a>
	</div>
	
	<div class="postText">
		声明：本文内容主要译自Nauman Leghari的Using log4net，亦加入了个人的一点心得(节3.1.4)。<br>请在这里下载<a href="http://files.cnblogs.com/dragon/Log4NetTester.rar">示例代码</a>&nbsp; <br>
<p class="MsoNormal" style="margin-left: 21.25pt; text-indent: -21.25pt;"><b style=""><span style="" lang="EN-US"><span style="">1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">简介</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">1.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Log4net</span></b><b style=""><span style="font-family: 宋体;">的优点：</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">几乎所有的大型应用都会有自己的用于跟踪调试的</span><span lang="EN-US">API</span><span style="font-family: 宋体;">。因为一旦程序被部署以后，就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">经验表明，日志记录往往是软件开发周期中的重要组成部分。它具有以下几个优点：它可以提供应用程序运行时的精确环境，可供开发人员尽快找到应用程序中的</span><span lang="EN-US">Bug</span><span style="font-family: 宋体;">；一旦在程序中加入了</span><span lang="EN-US">Log </span><span style="font-family: 宋体;">输出代码，程序运行过程中就能生成并输出日志信息而无需人工干预。另外，日志信息可以输出到不同的地方（控制台，文件等）以备以后研究之用。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">Log4net</span><span style="font-family: 宋体;">就是为这样一个目的设计的，用于</span><span lang="EN-US">.NET</span><span style="font-family: 宋体;">开发环境的日志记录包。</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">1.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Log4net</span></b><b style=""><span style="font-family: 宋体;">的安装：</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">用户可以从</span><span lang="EN-US"><a href="http://logging.apache.org/log4net/"><span style="color: windowtext; text-decoration: none;">http://logging.apache.org/log4net/</span></a></span><span style="font-family: 宋体;">下载</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">的源代码。解压软件包后，在解压的</span><span lang="EN-US">src</span><span style="font-family: 宋体;">目录下将</span><span lang="EN-US">log4net.sln</span><span style="font-family: 宋体;">载入</span><span lang="EN-US">Visual Studio .NET</span><span style="font-family: 宋体;">，编译后可以得到</span><span lang="EN-US">log4net.dll</span><span style="font-family: 宋体;">。用户要在自己的程序里加入日志功能，只需将</span><span lang="EN-US">log4net.dll</span><span style="font-family: 宋体;">引入工程即可。</span> </p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21.25pt; text-indent: -21.25pt;"><b style=""><span style="" lang="EN-US"><span style="">2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Log4net</span></b><b style=""><span style="font-family: 宋体;">的结构</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net </span><span style="font-family: 宋体;">有四种主要的组件，分别是</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">（记录器）</span><span lang="EN-US">, Repository</span><span style="font-family: 宋体;">（库）</span><span lang="EN-US">, Appender</span><span style="font-family: 宋体;">（附着器）以及</span><span lang="EN-US"> Layout</span><span style="font-family: 宋体;">（布局）</span><span lang="EN-US">.</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Logger<a name="Logger"></a><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.1.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Logger</span></b><b style=""><span style="font-family: 宋体;">接口</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Logger</span><span style="font-family: 宋体;">是应用程序需要交互的主要组件，它用来产生日志消息。产生的日志消息并不直接显示，还要预先经过</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">的格式化处理后才会输出。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Logger</span><span style="font-family: 宋体;">提供了多种方式来记录一个日志消息，你可以在你的应用程序里创建多个</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">，每个实例化的</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象都被</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架作为命名实体</span><span lang="EN-US">(named entity)</span><span style="font-family: 宋体;">来维护。这意味着为了重用</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象，你不必将它在不同的类或对象间传递，只需要用它的名字为参数调用就可以了。</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架使用继承体系，继承体系类似于</span><span lang="EN-US">.NET</span><span style="font-family: 宋体;">中的名字空间。也就是说，如果有两个</span><span lang="EN-US">logger,</span><span style="font-family: 宋体;">分别被定义为</span><span lang="EN-US">a.b.c</span><span style="font-family: 宋体;">和</span><span lang="EN-US">a.b</span><span style="font-family: 宋体;">，那么我们说</span><span lang="EN-US">a.b</span><span style="font-family: 宋体;">是</span><span lang="EN-US">a.b.c</span><span style="font-family: 宋体;">的祖先。每一个</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">都继承了祖先的属性</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Log4net</span><span style="font-family: 宋体;">框架定义了一个</span><span lang="EN-US">ILog</span><span style="font-family: 宋体;">接口，所有的</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">类都必须实现这个接口。如果你想实现一个自定义的</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">，你必须首先实现这个接口。你可以参考在</span><span lang="EN-US">/extension</span><span style="font-family: 宋体;">目录下的几个例子。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">ILog</span><span style="font-family: 宋体;">接口的定义如下：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">public interface ILog</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">{</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Debug(object message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Info(object message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Warn(object message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Error(object message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Fatal(object message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">//</span><span style="font-family: 宋体;">以上的每一个方法都有一个重载的方法，用来支持异常处理。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">//</span><span style="font-family: 宋体;">每一个重载方法都如下所示，有一个异常类型的附加参数。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>void Debug(object message, Exception ex);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>// ...</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">//Boolean </span><span style="font-family: 宋体;">属性用来检查</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">的日志级别</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">//</span><span style="font-family: 宋体;">（我们马上会在后面看到日志级别）</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>bool isDebugEnabled;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>bool isInfoEnabled;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>//… </span><span style="font-family: 宋体;">其他方法对应的</span><span lang="EN-US">Boolean</span><span style="font-family: 宋体;">属性</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">}</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Log4net</span><span style="font-family: 宋体;">框架定义了一个叫做</span><span lang="EN-US">LogManager</span><span style="font-family: 宋体;">的类，用来管理所有的</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">对象。它有一个</span><span lang="EN-US">GetLogger()</span><span style="font-family: 宋体;">静态方法，用我们提供的名字参数来检索已经存在的</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象。如果框架里不存在该</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象，它也会为我们创建一个</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象。代码如下所示：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">log4net.ILog log = log4net.LogManager.GetLogger("logger-name");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">通常来说，我们会以类（</span><span lang="EN-US">class</span><span style="font-family: 宋体;">）的类型（</span><span lang="EN-US">type</span><span style="font-family: 宋体;">）为参数来调用</span><span lang="EN-US">GetLogger()</span><span style="font-family: 宋体;">，以便跟踪我们正在进行日志记录的类。传递的类</span><span lang="EN-US">(class)</span><span style="font-family: 宋体;">的类型</span><span lang="EN-US">(type)</span><span style="font-family: 宋体;">可以用</span><span lang="EN-US">typeof(Classname)</span><span style="font-family: 宋体;">方法来获得，或者可以用如下的反射方法来获得：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">System.Reflection.MethodBase.GetCurrentMethod().DeclaringType</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">尽管符号长了一些，但是后者可以用于一些场合，比如获取调用方法的类</span><span lang="EN-US">(class)</span><span style="font-family: 宋体;">的类型</span><span lang="EN-US">(type)</span><span style="font-family: 宋体;">。</span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.1.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">日志的级别</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">正如你在</span><span lang="EN-US">ILog</span><span style="font-family: 宋体;">的接口中看到的一样，有五种不同的方法可以跟踪一个应用程序。事实上，这五种方法是运作在</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象设置的不同日志优先级别上。这几种不同的级别是作为常量定义在</span><span lang="EN-US">log4net.spi.Level</span><span style="font-family: 宋体;">类中。你可以在程序中使用任何一种方法。但是在最后的发布中你也许不想让所有的代码来浪费你的</span><span lang="EN-US">CPU</span><span style="font-family: 宋体;">周期，因此，框架提供了</span><span lang="EN-US">7</span><span style="font-family: 宋体;">种级别和相应的</span><span lang="EN-US">Boolean</span><span style="font-family: 宋体;">属性来控制日志记录的类型。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">Level</span><span style="font-family: 宋体;">有以下几种取值</span><span lang="EN-US"> </span></p>
<table class="MsoNormalTable" style="margin-left: 48.75pt;" border="1" cellpadding="0">
<tbody>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span style="font-family: 宋体;">级别</span><span lang="EN-US"><o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span style="font-family: 宋体;">允许的方法</span><span lang="EN-US"><o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">Boolean</span></b><b style=""><span style="font-family: 宋体;">属性</span><span lang="EN-US"><o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal"><b style=""><span style="font-family: 宋体;">优先级别</span><span lang="EN-US"><o:p></o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">OFF<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">&nbsp;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">&nbsp;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal"><b style=""><span lang="EN-US">Highest<o:p></o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">FATAL<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">void Fatal(...);<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">bool IsFatalEnabled;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">RROR<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">void Error(...);<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">bool IsErrorEnabled;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">WARN<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">void Warn(...);<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">bool IsWarnEnabled;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">INFO<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">void Info(...);<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">bool IsInfoEnabled;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">DEBUG<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US">void Debug(...);<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal"><b style=""><span lang="EN-US">bool IsDebugEnabled;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td></tr>
<tr style="">
<td style="padding: 1.5pt; width: 51.75pt;" width="69">
<p class="MsoNormal"><b style=""><span lang="EN-US">ALL<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 88.5pt;" width="118">
<p class="MsoNormal"><b style=""><span lang="EN-US"><o:p>&nbsp;</o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 115.5pt;" width="154">
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><b style=""><span lang="EN-US">&nbsp;<o:p></o:p></span></b> </p></td>
<td style="padding: 1.5pt; width: 60.75pt;" width="81">
<p class="MsoNormal"><b style=""><span lang="EN-US">Lowest<o:p></o:p></span></b> </p></td></tr></tbody></table>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt; text-align: center;" align="center"><span style="font-family: 宋体;">表</span><span lang="EN-US">1<span style="">&nbsp; </span>Logger</span><span style="font-family: 宋体;">的日志级别</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">在</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架里，通过设置配置文件，每个日志对象都被分配了一个日志优先级别。如果没有给一个日志对象显式地分配一个级别，那么该对象会试图从他的祖先继承一个级别值。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">ILog</span><span style="font-family: 宋体;">接口的每个方法都有一个预先定义好了的级别值。正如你在表</span><span lang="EN-US">1</span><span style="font-family: 宋体;">看到的，</span><span lang="EN-US">ILog</span><span style="font-family: 宋体;">的</span><span lang="EN-US">Inof()</span><span style="font-family: 宋体;">方法具有</span><span lang="EN-US">INFO</span><span style="font-family: 宋体;">级别。同样的，以此类推，</span><span lang="EN-US">Error()</span><span style="font-family: 宋体;">方法具有</span><span lang="EN-US">ERROR</span><span style="font-family: 宋体;">级别。当我们使用以上的任何一种方法时，</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架会检查日志对象</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">的级别和方法的级别。只有当方法的级别高于日志级别时，日志请求才会被接受并执行。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">举例说明，当你创建了一个日志对象，并且把他的级别设置为</span><span lang="EN-US">INFO</span><span style="font-family: 宋体;">。于是框架会设置日志的每个</span><span lang="EN-US">Boolean</span><span style="font-family: 宋体;">属性。当你调用相应的日志方法时，框架会检查相应的</span><span lang="EN-US">Boolean</span><span style="font-family: 宋体;">属性，以决定该方法能不能执行。如下的代码：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Logger.Info("message");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Logger.Debug("message");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Logger.Warn("message");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">对于第一种方法，</span><span lang="EN-US">Info()</span><span style="font-family: 宋体;">的级别等与日志的级别（</span><span lang="EN-US">INFO</span><span style="font-family: 宋体;">），因此日志请求会被传递，我们可以得到输出结果</span><span lang="EN-US">”message”</span><span style="font-family: 宋体;">。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">对于第二种方法，</span><span lang="EN-US">Debug()</span><span style="font-family: 宋体;">的级别低于日志对象</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">的日志级别</span><span lang="EN-US">(INFO)</span><span style="font-family: 宋体;">，因此，日志请求被拒绝了，我们得不到任何输出。同样的，针对第三行语句，我们可以很容易得出结论。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">在表</span><span lang="EN-US">1</span><span style="font-family: 宋体;">中有两个特殊的级别：</span><span lang="EN-US">ALL</span><span style="font-family: 宋体;">和</span><span lang="EN-US">OFF</span><span style="font-family: 宋体;">。</span><span lang="EN-US">ALL</span><span style="font-family: 宋体;">表示允许所有的日志请求。</span><span lang="EN-US">OFF</span><span style="font-family: 宋体;">是拒绝所有的请求。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">你也可以显式地检查</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">对象的</span><span lang="EN-US">Boolean</span><span style="font-family: 宋体;">属性，如下所示：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">if (logger.IsDebugEnabled) </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">{</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>Logger.Debug("message");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">}</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Repository<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">Repository</span><span style="font-family: 宋体;">主要用于负责日志对象组织结构的维护。在</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">的以前版本中，框架仅支持分等级的组织结构</span><span lang="EN-US">(hierarchical organization)</span><span style="font-family: 宋体;">。这种等级结构本质上是库的一个实现，并且定义在</span><span lang="EN-US">log4net.Repository.Hierarchy </span><span style="font-family: 宋体;">名字空间中。要实现一个</span><span lang="EN-US">Repository</span><span style="font-family: 宋体;">，需要实现</span><span lang="EN-US">log4net.Repository.ILoggerRepository </span><span style="font-family: 宋体;">接口。但是通常并不是直接实现该接口，而是以</span><span lang="EN-US">log4net.Repository.LoggerRepositorySkeleton</span><span style="font-family: 宋体;">为基类继承。体系库</span> <span lang="EN-US">(hierarchical repository )</span><span style="font-family: 宋体;">则由</span><span lang="EN-US">log4net.Repository.Hierarchy.Hierarchy</span><span style="font-family: 宋体;">类实现。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">如果你是个</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架的使用者，而非扩展者，那么你几乎不会在你的代码里用到</span><span lang="EN-US">Repository</span><span style="font-family: 宋体;">的类。相反的，你需要用到</span><span lang="EN-US">LogManager</span><span style="font-family: 宋体;">类来自动管理库和日志对象。</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.3<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Appender<a name="Appender"></a><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">一个好的日志框架应该能够产生多目的地的输出。比如说输出到控制台或保存到一个日志文件。</span><span lang="EN-US">log4net </span><span style="font-family: 宋体;">能够很好的满足这些要求。它使用一个叫做</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">的组件来定义输出介质。正如名字所示，这些组件把它们附加到</span><span lang="EN-US">Logger</span><span style="font-family: 宋体;">日志组件上并将输出传递到输出流中。你可以把多个</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">组件附加到一个日志对象上。</span> <span lang="EN-US">Log4net</span><span style="font-family: 宋体;">框架提供了几个</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">组件。关于</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">提供的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">组件的完整列表可以在</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架的帮助手册中找到。有了这些现成的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">组件，一般来说你没有必要再自己编写了。但是如果你愿意，可以从</span><span lang="EN-US">log4net.Appender.AppenderSkeleton</span><span style="font-family: 宋体;">类继承。</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.4<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Appender Filters<a name="Filters"></a><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">一个</span><span lang="EN-US">Appender </span><span style="font-family: 宋体;">对象缺省地将所有的日志事件传递到输出流。</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">的过滤器</span><span lang="EN-US">(Appender Filters) </span><span style="font-family: 宋体;">可以按照不同的标准过滤日志事件。在</span><span lang="EN-US">log4net.Filter</span><span style="font-family: 宋体;">的名字空间下已经有几个预定义的过滤器。使用这些过滤器，你可以按照日志级别范围过滤日志事件，或者按照某个特殊的字符串进行过滤。你可以在</span><span lang="EN-US">API</span><span style="font-family: 宋体;">的帮助文件中发现更多关于过滤器的信息。</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">2.5<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">Layout<a name="Layout"></a><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">Layout </span><span style="font-family: 宋体;">组件用于向用户显示最后经过格式化的输出信息。输出信息可以以多种格式显示，主要依赖于我们采用的</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">组件类型。可以是线性的或一个</span><span lang="EN-US">XML</span><span style="font-family: 宋体;">文件。</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">组件和一个</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">组件一起工作。</span><span lang="EN-US">API</span><span style="font-family: 宋体;">帮助手册中有关于不同</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">组件的列表。一个</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">对象，只能对应一个</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">对象。要实现你自己的</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">类，你需要从</span><span lang="EN-US">log4net.Layout.LayoutSkeleton</span><span style="font-family: 宋体;">类继承，它实现了</span><span lang="EN-US">ILayout</span><span style="font-family: 宋体;">接口。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21.25pt; text-indent: -21.25pt;"><b style=""><span style="" lang="EN-US"><span style="">3<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">在程序中使用</span><span lang="EN-US">log4net<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">在开始对你的程序进行日志记录前，需要先启动</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">引擎。这意味着你需要先配置前面提到的三种组件。你可以用两种方法来设定配置：在单独的文件中设定配置或在代码中定义配置。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">因为下面几种原因，推荐在一个单独的文件中定义配置：</span> </p>
<p class="MsoNormal" style="margin-left: 63pt; text-indent: -21pt;"><span style="font-family: Wingdings;" lang="EN-US"><span style="">l<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体;">你不需要重新编译源代码就能改变配置；</span> </p>
<p class="MsoNormal" style="margin-left: 63pt; text-indent: -21pt;"><span style="font-family: Wingdings;" lang="EN-US"><span style="">l<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体;">你可以在程序正运行的时候就改变配置。这一点在一些</span><span lang="EN-US">WEB</span><span style="font-family: 宋体;">程序和远程过程调用的程序中有时很重要；</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">考虑到第一种方法的重要性，我们先看看怎样在文件中设定配置信息。</span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">定义配置文件</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">配置信息可以放在如下几种形式文件的一种中。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">在程序的配置文件里，如</span><span lang="EN-US">AssemblyName.config </span><span style="font-family: 宋体;">或</span><span lang="EN-US">web.config. </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">在你自己的文件里。文件名可以是任何你想要的名字，如</span><span lang="EN-US">AppName.exe.xyz</span><span style="font-family: 宋体;">等</span><span lang="EN-US">. </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架会在相对于</span><span lang="EN-US">AppDomain.CurrentDomain.BaseDirectory </span><span style="font-family: 宋体;">属性定义的目录路径下查找配置文件。框架在配置文件里要查找的唯一标识是</span><span lang="EN-US">&lt;log4net&gt;</span><span style="font-family: 宋体;">标签。一个完整的配置文件的例子如下：</span> </p>
<p class="MsoNormal" style="text-align: left;" align="left"><span style="font-size: 12pt; color: rgb(0, 51, 102); font-family: 'Courier New';" lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">&lt;configuration&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;configSections&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;section name="log4net" </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>type="log4net.Config.Log4NetConfigurationSectionHandler,</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>log4net-net-1.0" </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;/configSections&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;log4net&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;root&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;level value="WARN" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;appender-ref ref="LogFileAppender" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;appender-ref ref="ConsoleAppender" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;/root&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;logger name="testApp.Logging"&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;level value="DEBUG"/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;/logger&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;appender name="LogFileAppender" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>type="log4net.Appender.FileAppender" &gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="File" value="log-file.txt" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;</span>&lt;param name="AppendToFile" value="true" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;layout type="log4net.Layout.PatternLayout"&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="Header" value="[Header]\r\n"/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="Footer" value="[Footer]\r\n"/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="ConversionPattern" </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>value="%d [%t] %-5p %c [%x]<span style="">&nbsp; </span>- %m%n"</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/layout&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;filter type="log4net.Filter.LevelRangeFilter"&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="LevelMin" value="DEBUG" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="LevelMax" value="WARN" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/filter&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;/appender&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;appender name="ConsoleAppender" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>type="log4net.Appender.ConsoleAppender" &gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;layout type="log4net.Layout.PatternLayout"&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;param name="ConversionPattern" </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>value="%d [%t] %-5p %c [%x] - %m%n" </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;/layout&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><b style=""><span lang="EN-US"><span style="">&nbsp;&nbsp; </span><span style="">&nbsp;</span>&lt;/appender&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;/log4net&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">&lt;/configuration&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">你可以直接将上面的文本拷贝到任何程序中使用，但是最好还是能够理解配置文件是怎样构成的。</span> <span style="font-family: 宋体;">只有当你需要在应用程序配置文件中使用</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">配置时，才需要在</span><span lang="EN-US">&lt;configSection&gt;</span><span style="font-family: 宋体;">标签中加入</span><span lang="EN-US">&lt;section&gt;</span><span style="font-family: 宋体;">配置节点入口。对于其他的单独文件，只有</span><span lang="EN-US">&lt;log4net&gt;</span><span style="font-family: 宋体;">标签内的文本才是必需的，这些标签的顺序并不是固定的。下面我们依次讲解各个标签内文本的含义：</span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">&lt;root&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;root&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;level value="WARN" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;appender-ref ref="LogFileAppender" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;appender-ref ref="ConsoleAppender" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;/root&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">在框架的体系里，所有的日志对象都是根日志</span><span lang="EN-US">(root logger)</span><span style="font-family: 宋体;">的后代。</span> <span style="font-family: 宋体;">因此如果一个日志对象没有在配置文件里显式定义，则框架使用根日志中定义的属性。在</span><span lang="EN-US">&lt;root&gt;</span><span style="font-family: 宋体;">标签里，可以定义</span><span lang="EN-US">level</span><span style="font-family: 宋体;">级别值和</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">的列表。如果没有定义</span><span lang="EN-US">LEVEL</span><span style="font-family: 宋体;">的值，则缺省为</span><span lang="EN-US">DEBUG</span><span style="font-family: 宋体;">。可以通过</span><span lang="EN-US">&lt;appender-ref&gt;</span><span style="font-family: 宋体;">标签定义日志对象使用的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">对象。</span><span lang="EN-US">&lt;appender-ref&gt;</span><span style="font-family: 宋体;">声明了在其他地方定义的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">对象的一个引用。在一个</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">对象中的设置会覆盖根日志的设置。而对</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">属性来说，子日志对象则会继承父日志对象的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">列表。这种缺省的行为方式也可以通过显式地设定</span><span lang="EN-US">&lt;logger&gt;</span><span style="font-family: 宋体;">标签的</span><span lang="EN-US">additivity</span><span style="font-family: 宋体;">属性为</span><span lang="EN-US">false</span><span style="font-family: 宋体;">而改变。</span><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;logger name="testApp.Logging" additivity="false"&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;/logger&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Additivity</span><span style="font-family: 宋体;">的值缺省是</span><span lang="EN-US">true.</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">&lt;Logger&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;logger name="testApp.Logging"&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;level value="DEBUG"/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;/logger&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;logger&gt; </span><span style="font-family: 宋体;">元素预定义了一个具体日志对象的设置。然后通过调用</span><span lang="EN-US">LogManager.GetLogger(“testAPP.Logging”)</span><span style="font-family: 宋体;">函数，你可以检索具有该名字的日志。如果</span><span lang="EN-US">LogManager.GetLogger(…)</span><span style="font-family: 宋体;">打开的不是预定义的日志对象，则该日志对象会继承根日志对象的属性。知道了这一点，我们可以说，其实</span><span lang="EN-US">&lt;logger&gt;</span><span style="font-family: 宋体;">标签并不是必须的。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1.3<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">&lt;appender&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;appender name="LogFileAppender" </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>type="log4net.Appender.FileAppender" &gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;param name="File" value="log-file.txt" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;param name="AppendToFile" value="true" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;layout type="log4net.Layout.PatternLayout"&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;param name="Header" value="[Header]\r\n" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;param name="Footer" value="[Footer]\r\n"/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;param name="ConversionPattern" </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>value="%d [%t] %-5p %c - %m%n" </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>/&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;/layout&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;filter type="log4net.Filter.LevelRangeFilter"&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;param name="LevelMin" value="DEBUG" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>&lt;param name="LevelMax" value="WARN" /&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>&lt;/filter&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">&lt;/appender&gt;</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;</span></span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">在</span><span lang="EN-US">&lt;root&gt;</span><span style="font-family: 宋体;">标签或单个的</span><span lang="EN-US">&lt;logger&gt;</span><span style="font-family: 宋体;">标签里的</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">对象可以用</span><span lang="EN-US">&lt;appender&gt;</span><span style="font-family: 宋体;">标签定义。</span><span lang="EN-US">&lt;appender&gt;</span><span style="font-family: 宋体;">标签的基本形式如上面所示。它定义了</span><span lang="EN-US">appender</span><span style="font-family: 宋体;">的名字和类型。</span> <span style="font-family: 宋体;">另外比较重要的是</span><span lang="EN-US">&lt;appender&gt;</span><span style="font-family: 宋体;">标签内部的其他标签。不同的</span><span lang="EN-US">appender</span><span style="font-family: 宋体;">有不同的</span><span lang="EN-US">&lt;param&gt;</span><span style="font-family: 宋体;">标签。在这里，为了使用</span><span lang="EN-US">FileAppender,</span><span style="font-family: 宋体;">你需要一个文件名作为参数。另外还需要一个在</span><span lang="EN-US">&lt;appender&gt;</span><span style="font-family: 宋体;">标签内部定义一个</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">对象。</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">对象定义在它自己的</span><span lang="EN-US">&lt;layout&gt;</span><span style="font-family: 宋体;">标签内。</span><span lang="EN-US">&lt;layout&gt;</span><span style="font-family: 宋体;">标签的</span><span lang="EN-US">type</span><span style="font-family: 宋体;">属性定义了</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">的类型</span><span lang="EN-US">(</span><span style="font-family: 宋体;">在本例里是</span><span lang="EN-US">PatternLayout)</span><span style="font-family: 宋体;">，同时也确定了需要提供的参数值。</span><span lang="EN-US">Header</span><span style="font-family: 宋体;">和</span><span lang="EN-US">Footer</span><span style="font-family: 宋体;">标签提供了一个日志会话</span><span lang="EN-US">(logging session)</span><span style="font-family: 宋体;">开始和结束时输出的文字。有关每种</span><span lang="EN-US">appender</span><span style="font-family: 宋体;">的具体配置的例子，可以在</span><span lang="EN-US">log4net\doc\manual\example-config-appender.html</span><span style="font-family: 宋体;">中得到。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1.4<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">log4net.Layout.PatternLayout</span></b><b style=""><span style="font-family: 宋体;">中的转换模式</span><span lang="EN-US">(ConversionPattern)<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%m(message):</span><span style="font-family: 宋体;">输出的日志消息，如</span><span lang="EN-US">ILog.Debug(…)</span><span style="font-family: 宋体;">输出的一条消息</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%n(new line):</span><span style="font-family: 宋体;">换行</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%d(datetime):</span><span style="font-family: 宋体;">输出当前语句运行的时刻</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%r(run time):</span><span style="font-family: 宋体;">输出程序从运行到执行到当前语句时消耗的毫秒数</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%t(thread id):</span><span style="font-family: 宋体;">当前语句所在的线程</span><span lang="EN-US">ID</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%p(priority): </span><span style="font-family: 宋体;">日志的当前优先级别，即</span><span lang="EN-US">DEBUG</span><span style="font-family: 宋体;">、</span><span lang="EN-US">INFO</span><span style="font-family: 宋体;">、</span><span lang="EN-US">WARN…</span><span style="font-family: 宋体;">等</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%c(class):</span><span style="font-family: 宋体;">当前日志对象的名称，例如：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-family: 宋体;">模式字符串为：</span><span lang="EN-US">%<st1:chmetcnv w:st="on" unitname="C" sourcevalue="10" hasspace="False" negative="True" numbertype="1" tcsc="0">-10c</st1:chmetcnv> -%m%n</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-family: 宋体;">代码为：</span> </p>
<p class="MsoNormal" style="margin-left: 73.5pt; text-indent: 21pt;"><span lang="EN-US">ILog log=LogManager.GetLogger(“Exam.Log”);</span> </p>
<p class="MsoNormal" style="margin-left: 73.5pt; text-indent: 21pt;"><span lang="EN-US">log.Debug(“Hello”);</span> </p>
<p class="MsoNormal" style="margin-left: 73.5pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span><span style="font-family: 宋体;">则输出为下面的形式：</span> </p>
<p class="MsoNormal" style="margin-left: 73.5pt; text-indent: 21pt;"><span lang="EN-US">Exam.Log<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>- Hello</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%L</span><span style="font-family: 宋体;">：输出语句所在的行号</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%F</span><span style="font-family: 宋体;">：输出语句所在的文件名</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">%-</span><span style="font-family: 宋体;">数字：表示该项的最小长度，如果不够，则用空格填充</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">例如，转换模式为</span><span lang="EN-US">%r [%t]%-5p %c - %m%n </span><span style="font-family: 宋体;">的</span><span lang="EN-US"> PatternLayout </span><span style="font-family: 宋体;">将生成类似于以下内容的输出：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">176 [main] INFO<span style="">&nbsp; </span>org.foo.Bar - Located nearest gas station.</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.1.5<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span lang="EN-US">&lt;filter&gt;<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">最后，让我们看看在</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">元素里的</span><span lang="EN-US">&lt;filter&gt;</span><span style="font-family: 宋体;">标签。它定义了应用到</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">对象的过滤器。本例中，我们使用了</span><span lang="EN-US">LevelRangeFilter</span><span style="font-family: 宋体;">过滤器</span><span lang="EN-US">,</span><span style="font-family: 宋体;">它可以只记录</span><span lang="EN-US">LevelMin</span><span style="font-family: 宋体;">和</span><span lang="EN-US">LevelMax</span><span style="font-family: 宋体;">参数指定的日志级别之间的日志事件。可以在一个</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">上定义多个过滤器（</span><span lang="EN-US">Filter</span><span style="font-family: 宋体;">）</span><span lang="EN-US">,</span><span style="font-family: 宋体;">这些过滤器将会按照它们定义的顺序对日志事件进行过滤。其他过滤器的有关信息可以在</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">的</span><span lang="EN-US">SDK</span><span style="font-family: 宋体;">文档中找到。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">使用配置文件</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.2.1<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">关联配置文件</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">当我们创建了上面的配置文件后，我们接下来需要把它和我们的应用联系起来。缺省的，每个独立的可执行程序集都会定义它自己的配置。</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架使用</span><span lang="EN-US"> log4net.Config.DOMConfiguratorAttribute</span><span style="font-family: 宋体;">在程序集的级别上定义配置文件。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">例如：可以在项目的</span><span lang="EN-US">AssemblyInfo.cs</span><span style="font-family: 宋体;">文件里添加以下的语句</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">[assembly:log4net.Config.DOMConfigurator(ConfigFile="filename", </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>ConfigFileExtension="ext",Watch=true/false)]</span> </p>
<p class="MsoNormal" style="margin-left: 84pt; text-indent: -21pt;"><span style="font-family: Wingdings;" lang="EN-US"><span style="">l<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><b style=""><span lang="EN-US">ConfigFile:</span></b><span style="font-family: 宋体;">指出了我们的配置文件的路径及文件名，包括扩展名。</span> </p>
<p class="MsoNormal" style="margin-left: 84pt; text-indent: -21pt;"><span style="font-family: Wingdings;" lang="EN-US"><span style="">l<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><b style=""><span lang="EN-US">ConfigFileExtension:</span></b><span style="font-family: 宋体;">如果我们对被编译程序的程序集使用了不同的文件扩展名，那么我们需要定义这个属性，缺省的，程序集的配置文件扩展名为</span><span lang="EN-US">”config”</span><span style="font-family: 宋体;">。</span><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left: 84pt; text-indent: -21pt;"><span style="font-family: Wingdings;" lang="EN-US"><span style="">l<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><b style=""><span lang="EN-US">Watch (Boolean</span></b><b style=""><span style="font-family: 宋体;">属性</span><span lang="EN-US">):</span></b><span lang="EN-US"> log4net</span><span style="font-family: 宋体;">框架用这个属性来确定是否需要在运行时监视文件的改变。如果这个属性为</span><span lang="EN-US">true,</span><span style="font-family: 宋体;">那么</span><span lang="EN-US">FileSystemWatcher</span><span style="font-family: 宋体;">将会被用来监视文件的改变，重命名，删除等事件。</span><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">其中：</span><span lang="EN-US">ConfigFile</span><span style="font-family: 宋体;">和</span><span lang="EN-US">ConfigFileExtension</span><span style="font-family: 宋体;">属性不能同时使用，</span><span lang="EN-US">ConfigFile</span><span style="font-family: 宋体;">指出了配置文件的名字，例如，</span><span lang="EN-US">ConfigFile=”Config.txt”</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">ConfigFileExtension</span><span style="font-family: 宋体;">则是指明了和可执行程序集同名的配置文件的扩展名，例如，应用程序的名称是</span><span lang="EN-US">”test.exe”,ConfigFileExtension=”txt”,</span><span style="font-family: 宋体;">则配置文件就应该是</span><span lang="EN-US">”test.exe.txt” </span><span style="font-family: 宋体;">；</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">也可以不带参数应用</span><span lang="EN-US">DOMConfiguratio():</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;</span>[assembly: log4net.Config.DOMConfigurator()]</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">也可以在程序代码中用</span><span lang="EN-US">DOMConfigurator</span><span style="font-family: 宋体;">类打开配置文件。类的构造函数需要一个</span><span lang="EN-US">FileInfo</span><span style="font-family: 宋体;">对象作参数，以指出要打开的配置文件名。</span> <span style="font-family: 宋体;">这个方法和前面在程序集里设置属性打开一个配置文件的效果是一样的。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.DOMConfigurator.Configure(</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>new FileInfo("TestLogger.Exe.Config")); </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">DOMConfigurator </span><span style="font-family: 宋体;">类还有一个方法</span><span lang="EN-US">ConfigureAndWatch(..), </span><span style="font-family: 宋体;">用来配置框架并检测文件的变化。</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">以上的步骤总结了和配置相关的各个方面，下面我们将分两步来使用</span><span lang="EN-US">logger</span><span style="font-family: 宋体;">对象。</span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.2.2<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">创建或获取日志对象</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">日志对象会使用在配置文件里定义的属性。如果某个日志对象没有事先在配置文件里定义，那么框架会根据继承结构获取祖先节点的属性，最终的，会从根日志获取属性。如下所示：</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">Log4net.ILog log = Log4net.LogManager.GetLogger("MyLogger");</span> </p>
<p class="MsoNormal" style="margin-left: 70.9pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.2.3<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">输出日志信息</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span style="font-family: 宋体;">可以使用</span><span lang="EN-US">ILog</span><span style="font-family: 宋体;">的几种方法输出日志信息。你也可以在调用某方法前先检查</span><span lang="EN-US">IsXXXEnabled</span><span style="font-family: 宋体;">布尔变量，再决定是否调用输出日志信息的函数，这样可以提高程序的性能。因为框架在调用如</span><span lang="EN-US">ILog.Debug(…)</span><span style="font-family: 宋体;">这样的函数时，也会先判断是否满足</span><span lang="EN-US">Level</span><span style="font-family: 宋体;">日志级别条件。</span><span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">if (log.IsDebugEnabled) log.Debug("message");</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US">if (log.IsInfoEnabled) log.Info("message);</span> </p>
<p class="MsoNormal" style="margin-left: 42pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 49.6pt; text-indent: -1cm;"><b style=""><span style="" lang="EN-US"><span style="">3.3<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">在程序中配置</span><span lang="EN-US">log4net<o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">除了前面讲的用一个配置文件来配置</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">以外，还可以在程序中用代码来配置</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架。如下面的例子</span><span lang="EN-US">:</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">// </span><span style="font-family: 宋体;">和</span><span lang="EN-US">PatternLayout</span><span style="font-family: 宋体;">一起使用</span><span lang="EN-US">FileAppender </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator.Configure(</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>new log4net.Appender.FileAppender(</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>new log4net.Layout.PatternLayout("%d </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[%t]%-5p %c [%x] - %m%n"),"testfile.log"));</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">// using a FileAppender with an XMLLayout</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator.Configure( </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>new log4net.Appender.FileAppender( </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>new log4net.Layout.XMLLayout(),"testfile.xml"));</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">// using a ConsoleAppender with a PatternLayout</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator.Configure( </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>new log4net.Appender.ConsoleAppender(</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>new log4net.Layout.PatternLayout("%d </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>[%t] %-5p %c - %m%n")));</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">// using a ConsoleAppender with a SimpleLayout</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator.Configure(</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp; </span>new log4net.Appender.ConsoleAppender(new </span></p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>log4net.Layout.SimpleLayout()));</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">尽管这里用代码配置</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">也很方便，但是你却不能分别配置每个日志对象。所有的这些配置都是被应用到根日志上的。</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator </span><span style="font-family: 宋体;">类使用静态方法</span><span lang="EN-US">Configure </span><span style="font-family: 宋体;">设置一个</span><span lang="EN-US">Appender </span><span style="font-family: 宋体;">对象。而</span><span lang="EN-US">Appender</span><span style="font-family: 宋体;">的构造函数又会相应的要求</span><span lang="EN-US">Layout</span><span style="font-family: 宋体;">对象。你也可以不带参数直接调用</span><span lang="EN-US">BasicConfigurator.Configure()</span><span style="font-family: 宋体;">，它会使用一个缺省的</span><span lang="EN-US">PatternLayout</span><span style="font-family: 宋体;">对象，在一个</span><span lang="EN-US">ConsoleAppender</span><span style="font-family: 宋体;">中输出信息。如下所示：</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">log4net.Config.BasicConfigurator.Configure();</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">在输出时会显示如下格式的信息：</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">0 [1688] DEBUG log<st1:chmetcnv w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0">1 A</st1:chmetcnv> B C - Test</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span lang="EN-US">20 [1688] INFO log<st1:chmetcnv w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0">1 A</st1:chmetcnv> B C - Test</span> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">当</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">框架被配置好以后，就可以如前所述使用日志功能了。</span> </p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span> </p>
<p class="MsoNormal" style="margin-left: 21.25pt; text-indent: -21.25pt;"><b style=""><span style="" lang="EN-US"><span style="">4<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></b><b style=""><span style="font-family: 宋体;">总结</span><span lang="EN-US"><o:p></o:p></span></b> </p>
<p class="MsoNormal" style="margin-left: 21pt; text-indent: 21pt;"><span style="font-family: 宋体;">使用</span><span lang="EN-US">log4net</span><span style="font-family: 宋体;">可以很方便地为应用添加日志功能。应用</span><span lang="EN-US">Log4net</span><span style="font-family: 宋体;">，使用者可以很精确地控制日志信息的输出，减少了多余信息，提高了日志记录性能。同时，通过外部配置文件，用户可以不用重新编译程序就能改变应用的日志行为，使得用户可以根据情况灵活地选择要记录的信息。</span> </p>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(124254,6967,1)"> 
		<span class="diggnum" id="digg_count_124254">2</span>
	</div>
	<div class="buryit" onclick="DiggIt(124254,6967,2)"> 
		<span class="burynum" id="bury_count_124254">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_124254">0</span>	
	<div class="diggword" id="digg_word_124254">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/dragon/archive/2004/10/24/56024.html">« </a> 上一篇：<a href="http://www.cnblogs.com/dragon/archive/2004/10/24/56024.html" title="发布于2004-10-24 09:08">一些写英文简历的词汇吧</a><br>
<a href="http://www.cnblogs.com/dragon/archive/2005/03/24/124771.html">» </a> 下一篇：<a href="http://www.cnblogs.com/dragon/archive/2005/03/24/124771.html" title="发布于2005-03-24 12:39">开发Visual Studio风格的用户界面－－MagicLibrary使用指南</a><br>
</div>





<div id="post_body_ad" style="margin-top: 5px;"><div id="google_ads_div_cnblogs_blogpost_body">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_body" id="google_ads_iframe_cnblogs_blogpost_body" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>
</div>


	</div>
	
	<div class="postfoot">
		posted on 2005-03-24 08:17 <a href="http://www.cnblogs.com/dragon/">sema</a> 阅读(38494) <a href="#commentform">评论(89)</a> &nbsp;<a href="http://www.cnblogs.com/dragon/admin/EditPosts.aspx?postid=124254">编辑</a> <a href="http://www.cnblogs.com/dragon/AddToFavorite.aspx?id=124254">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/dragon/category/11625.html">技术研究</a>
	</div>
</div>
<img src="124254.html" height="1" width="1">

<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html"
dc:identifier="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/dragon/services/trackbacks/124254.aspx" />
</rdf:RDF>
-->

<a name="pagedcomment"></a>
<a name="评论">
<br>
</a><div id="comments">
<a name="评论">	</a><h3><a name="评论">评论</a></h3>
<a name="评论">		<span id="span_comment_maxid" style="display: none;">1694173</span>
		
				</a><div class="post"><a name="评论">			
					</a><div class="postTitle">
<a name="评论">						</a><a href="#124579">#1楼</a><a name="124579" id="comment_anchor_124579"></a>
							
								2005-03-24 09:24
							
						<a id="Comments1_CommentList_ctl00_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://blog.aspcool.com/donaldxu" target="_top">Donaldxu[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_124579" class="blog_comment_body">谢谢，正想研究一下Log4NET，收藏了</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("Donaldxu",124579,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(124579,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#124609">#2楼</a><a name="124609" id="comment_anchor_124609"></a>
							
								2005-03-24 09:53
							
						<a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/KingofSC/" target="_top">KingofSC</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/KingofSC" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_124609" class="blog_comment_body">有一点不明白
<br>在开始对你的程序进行日志记录前，需要先启动log4net引擎。
<br>不知道Log4Net是以库的形式附带在应用程序上运行
<br>还是有自己独立的app引擎？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("KingofSC",124609,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(124609,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=KingofSC" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#124614">#3楼</a><a name="124614" id="comment_anchor_124614"></a>
							
								2005-03-24 10:01
							
						<a id="Comments1_CommentList_ctl02_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.alphatom.com" target="_top">Samuel[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_124614" class="blog_comment_body">log4net是一个库，使用的时候要创建一个对象</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("Samuel",124614,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(124614,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#124629">#4楼</a><a name="124629" id="comment_anchor_124629"></a>
							
								2005-03-24 10:15
							
						<a id="Comments1_CommentList_ctl03_NameLink" href="http://www.cnblogs.com/KingofSC/" target="_top">KingofSC</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/KingofSC" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_124629" class="blog_comment_body">对程序集“E:\App Tools\Program\DotNet\log4net-1.2.0-beta8\log4net-1.2.0-beta8\src\obj\Release\log4net.dll”签名时加密失败 --“读取密钥文件“..\..\..\log4net.snk”时出错 -- 系统找不到指定的文件。 ”
<br>
<br>怎么release编译不过</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("KingofSC",124629,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(124629,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=KingofSC" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl03$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl03_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#124636">#5楼</a><a name="124636" id="comment_anchor_124636"></a>
							
								2005-03-24 10:21
							
						<a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/KingofSC/" target="_top">KingofSC</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/KingofSC" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_124636" class="blog_comment_body">哦，原来是强名称的问题</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("KingofSC",124636,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(124636,"fCSTqPKqjRZip7QN3lI4xcYq8zP5Sm+GoPTD/ibCiom2xnxcbpOxdA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=KingofSC" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl04$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl04_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#125789">#6楼</a><a name="125789" id="comment_anchor_125789"></a>
							
								2005-03-25 18:30
							
						<a id="Comments1_CommentList_ctl05_NameLink" target="_blank">netwyh</a>
					</div>
					<div class="postText">
						<span id="comment_body_125789" class="blog_comment_body">为什么总报这个错误：
<br>log4net:ERROR No output stream or file set for the appender named [].</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("netwyh",125789,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(125789,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl05$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl05_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#127406">#7楼</a><a name="127406" id="comment_anchor_127406"></a>
							
								2005-03-28 20:06
							
						<a id="Comments1_CommentList_ctl06_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://logger%E7%9A%84%E6%97%A5%E5%BF%97%E7%BA%A7%E5%88%AB%E5%9C%A8%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%90%8E%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%9F" target="_top">netwyh[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_127406" class="blog_comment_body">&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
<br> &lt;log4net&gt; 
<br>	&lt;root&gt; 
<br>      &lt;level value="OFF" /&gt; 
<br>      &lt;appender-ref ref="LogFileAppender" /&gt;
<br>    &lt;/root&gt; 
<br>    &lt;!--&lt;logger name="mytest"&gt;
<br>	  &lt;appender-ref ref="LogFileAppender" /&gt;
<br>      &lt;level value="OFF"/&gt;
<br>    &lt;/logger&gt;--&gt;
<br>    &lt;appender name="LogFileAppender" 
<br>             type="log4net.Appender.FileAppender" &gt; 
<br>      &lt;param name="File" value="log-file.txt" /&gt; 
<br>      &lt;param name="AppendToFile" value="true" /&gt; 
<br>      &lt;layout type="log4net.Layout.PatternLayout"&gt; 	
<br>        &lt;param name="ConversionPattern" 
<br>           value="%d [%t] %-5p %c [%x] &amp;lt;%X{auth}&amp;gt;%n - %m%n" /&gt; 
<br>      &lt;/layout&gt; 
<br>      
<br>    &lt;/appender&gt; 
<br> &lt;/log4net&gt; </span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("netwyh",127406,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(127406,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl06$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl06_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#127407">#8楼</a><a name="127407" id="comment_anchor_127407"></a>
							
								2005-03-28 20:07
							
						<a id="Comments1_CommentList_ctl07_NameLink" target="_blank">netwyh</a>
					</div>
					<div class="postText">
						<span id="comment_body_127407" class="blog_comment_body">日志级别设置不起作用？上面是我的配置文件</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("netwyh",127407,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(127407,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl07$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl07_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#129475">#9楼</a><a name="129475" id="comment_anchor_129475"></a>[<span class="louzhu">楼主</span>]
							
								2005-03-31 17:30
							
						<a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_129475" class="blog_comment_body">很抱歉,这一段时间一直很忙,所以现在才回复.我看你上面的配置文件,猜想可能是你编写配置文件的方式不正确.如果是在WinForm程序里使用,你可以按照这样的步骤:
<br>1.添加log4net引用
<br>2.为项目新增一个文件,选取新增向导里的"应用程序配置文件",则项目里会增加一个app.config文件.当程序编译后,会在你的执行目录下生成一个&lt;你的程序集名&gt;.exe.config文件内容和本文件一样
<br>3.编辑app.config文件如下：
<br>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
<br>&lt;configuration&gt; 
<br>	&lt;configSections&gt; 
<br>		&lt;section name="log4net" 
<br>      type="log4net.Config.Log4NetConfigurationSectionHandler, 
<br>            log4net-net-1.0" 
<br>		/&gt; 
<br>	&lt;/configSections&gt; 
<br>
<br>
<br>	&lt;log4net&gt; 
<br>		&lt;root&gt; 
<br>			&lt;level value="ALL" /&gt; 
<br>			&lt;appender-ref ref="LogFileAppender" /&gt; 
<br>		&lt;/root&gt; 
<br>
<br>		&lt;appender name="LogFileAppender"  type="log4net.Appender.FileAppender" &gt; 
<br>			&lt;param name="File" value="log-file.txt" /&gt; 
<br>			&lt;param name="AppendToFile" value="true" /&gt; 
<br>			&lt;layout type="log4net.Layout.PatternLayout"&gt; 
<br>				&lt;param name="ConversionPattern"  value="%d [%t] %-5p %c [%x] &amp;lt;%X{auth}&amp;gt;%n - %m%n" /&gt; 
<br>			&lt;/layout&gt; 
<br>		&lt;/appender&gt; 
<br>	&lt;/log4net&gt; 
<br>
<br>&lt;/configuration&gt;
<br>这里请注意&lt;configuration&gt; 和&lt;configurations&gt;标签不能少
<br>4.编辑Assembly.cs文件,添加如下内容:
<br>[assembly:log4net.Config.DOMConfigurator( ConfigFileExtension="config",Watch=true)] 
<br>5.在程序里添加如下代码
<br>log4net.ILog log = log4net.LogManager.GetLogger("MyLogger");
<br>log.Debug("test");
<br>
<br>这时你再运行程序,就应该可以看到结果了,我试过如果设置
<br>level = "OFF",则输出是没有结果的，改成"ALL"是有结果的
<br>
我在文章的开头添加了示例代码下载，你可以参考参考
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",129475,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(129475,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl08$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl08_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#130415">#10楼</a><a name="130415" id="comment_anchor_130415"></a>
							
								2005-04-01 18:17
							
						<a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/pfengk/" target="_top">音乐虫子</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%9f%b3%e4%b9%90%e8%99%ab%e5%ad%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_130415" class="blog_comment_body">谢谢，现在我用的就是这个，收藏先，慢慢研究</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("音乐虫子",130415,"0cY57mYr9/pph5W9zqZncdjG8QtzjtBu8FWZh8rcbY0vyqE2un/ZEg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(130415,"0cY57mYr9/pph5W9zqZncdjG8QtzjtBu8FWZh8rcbY0vyqE2un/ZEg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%9f%b3%e4%b9%90%e8%99%ab%e5%ad%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl09$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl09_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#167422">#11楼</a><a name="167422" id="comment_anchor_167422"></a>
							
								2005-06-03 16:26
							
						<a id="Comments1_CommentList_ctl10_NameLink" target="_blank">zhy</a>
					</div>
					<div class="postText">
						<span id="comment_body_167422" class="blog_comment_body">为什么我
<br>编辑AssemblyInfo.cs文件,添加如下内容: 
<br>[assembly:log4net.Config.DOMConfigurator( ConfigFileExtension="config",Watch=true)] 
<br>
<br>结果编译的时候 告诉我   log4net.Config.DOMConfigurator  不时属性类。
<br>我是按照你 恢复 netwyh  的文章里 一部一部  配置的 ，
<br>先配置了 app.config ,粘贴过去了，然后 
<br>编辑 AssemblyInfo.cs 文件 
<br>也是粘贴的。
<br>
<br>然后再界面实例化 调用，结果 没有编译成功，
<br>错误出在 Asse3mblyInfo.cs  中的 
<br>log4net.Config.DOMConfigurator 不时属性类 </span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("zhy",167422,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(167422,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl10$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl10_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#167600">#12楼</a><a name="167600" id="comment_anchor_167600"></a>
							
								2005-06-03 21:41
							
						<a id="Comments1_CommentList_ctl11_NameLink" href="http://www.cnblogs.com/dragon" target="_top">sema</a>
					</div>
					<div class="postText">
						<span id="comment_body_167600" class="blog_comment_body"><span><a href="mailto:%E4%BD%A0%E8%83%BD%E4%B8%8D%E8%83%BD%E6%8A%8A%E4%BD%A0%E7%9A%84%E5%B7%A5%E7%A8%8B%E6%96%87%E4%BB%B6%E5%8F%91%E7%BB%99%E6%88%91%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E5%B8%AE%E4%BD%A0%E7%9C%8B%E7%9C%8B%EF%BC%8Cluo_jl@std.com.cn%E3%80%82%E5%8F%A6%E5%A4%96%E6%88%91%E4%B8%8A%E9%9D%A2%E7%BB%99%E5%87%BA%E4%BA%86%E4%B8%80%E4%B8%AA%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81%EF%BC%8C%E4%BD%A0%E8%83%BD%E4%B8%8B%E8%BD%BD%E5%B9%B6%E7%BC%96%E8%AF%91%E9%80%9A%E8%BF%87%E4%B9%88%EF%BC%9F" class="smarterwiki-linkify">你能不能把你的工程文件发给我，我可以帮你看看，luo_jl@std.com.cn。另外我上面给出了一个示例代码，你能下载并编译通过么？</a></span></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",167600,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(167600,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl11$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl11_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#167603">#13楼</a><a name="167603" id="comment_anchor_167603"></a>[<span class="louzhu">楼主</span>]
							
								2005-06-03 21:45
							
						<a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_167603" class="blog_comment_body">对了，根据我的经验，你提的那个错误，一般来讲，可能是因为你把类名打错了，你可以对照我的示例代码先检查一下</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",167603,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(167603,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl12$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl12_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#193878">#14楼</a><a name="193878" id="comment_anchor_193878"></a>
							
								2005-07-16 09:52
							
						<a id="Comments1_CommentList_ctl13_NameLink" target="_blank">fox[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_193878" class="blog_comment_body">  按照搂主的方法配制后，发现找不到log输出文件，请问输出文件应该在什么位置？如果不能输出是什么原因？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("fox",193878,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(193878,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl13$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl13_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#194679">#15楼</a><a name="194679" id="comment_anchor_194679"></a>
							
								2005-07-17 21:55
							
						<a id="Comments1_CommentList_ctl14_NameLink" href="http://www.cnblogs.com/sema/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_194679" class="blog_comment_body">To fox:
<br>1、你可以先试试我的示例代码，看能够有Log文件，然后再对照比较一下你的代码，也许会找到原因
<br><span><a href="mailto:2%E3%80%81%E5%A6%82%E6%9E%9C%E5%AE%9E%E5%9C%A8%E4%B8%8D%E8%A1%8C%EF%BC%8C%E8%AF%B7%E6%8A%8A%E4%BD%A0%E7%9A%84%E5%B7%A5%E7%A8%8B%E5%8F%91%E7%BB%99%E6%88%91%EF%BC%8C%E6%88%91%E5%8F%AF%E4%BB%A5%E5%B8%AE%E4%BD%A0%E7%9C%8B%E7%9C%8B.luo_jl@std.com.cn." class="smarterwiki-linkify">2、如果实在不行，请把你的工程发给我，我可以帮你看看.luo_jl@std.com.cn.</a> ^_^!</span></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",194679,"zry95nDHhxXzWv4gPSlQh5DdRw58PiRfScMdI6Y8GzadS1ZnRoB1mg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(194679,"zry95nDHhxXzWv4gPSlQh5DdRw58PiRfScMdI6Y8GzadS1ZnRoB1mg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl14$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl14_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#197409">#16楼</a><a name="197409" id="comment_anchor_197409"></a>
							
								2005-07-21 15:33
							
						<a id="Comments1_CommentList_ctl15_NameLink" target="_blank">paopaotang[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_197409" class="blog_comment_body">我是在webform里按照你提示的步骤一步步做的，但是最后运行时为什么出不来llog文件呢？请问是什么原因,或者我应该怎么做配置？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("paopaotang",197409,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(197409,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl15$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl15_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#198335">#17楼</a><a name="198335" id="comment_anchor_198335"></a>[<span class="louzhu">楼主</span>]
							
								2005-07-22 20:06
							
						<a id="Comments1_CommentList_ctl16_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_198335" class="blog_comment_body">Webform和Winform可能有些小区别，你可能要把配置部分放在Web.config中，如果还是不行，你可以在Application_Start中用代码来启动Log4net</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",198335,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(198335,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl16$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl16_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#199264">#18楼</a><a name="199264" id="comment_anchor_199264"></a>[<span class="louzhu">楼主</span>]
							
								2005-07-24 22:00
							
						<a id="Comments1_CommentList_ctl17_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_199264" class="blog_comment_body">To fox &amp; paopaotang <br>我把你发给我的Web工程文件修改了一下，已经成功输出log文件了，我将该示例上传，请按以下步骤执行 <br>1、将该文件解压后，将Form1目录进行web共享 <br>2、修改Form1目录的安全属性，为ASPNET用户增加该目录的读写权限，该权限是为了能够让Web程序向该目录写log文件 <br>3、我将你AssemblyInfo.cs文件里的 <br>[assembly:log4net.Config.DOMConfigurator( ConfigFileExtension="config",Watch=true)] <br>改成了 <br>[assembly:log4net.Config.DOMConfigurator( ConfigFile="Web.config",Watch=true)] <br>因为ConfigFileExtension的意思是说将寻找和程序集同名，且扩展名为config的文件为配置文件。我给你修改后意思是指，以Web.config为配置文件 <br><a href="http://www.cnblogs.com/Files/dragon/log4net-webformExam.rar">下载示例文件</a><br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",199264,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(199264,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl17$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl17_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#199779">#19楼</a><a name="199779" id="comment_anchor_199779"></a>
							
								2005-07-25 17:13
							
						<a id="Comments1_CommentList_ctl18_NameLink" target="_blank">paopaotang[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_199779" class="blog_comment_body">首先感谢sema提供的帮助，在他的指引下，我又尝试了其他两种设置，均指对AssemblyInfo.cs文件里内容的设置
<br>1. [assembly:log4net.Config.DOMConfigurator( )] 
<br>
<br>2. [assembly:log4net.Config.DOMConfigurator( ConfigFile="web.config",Watch=true)] 
<br>
<br>3. [assembly: log4net.Config.DOMConfiguratorAttribute(Watch=true)] 
<br>将上述三条语句中任意一条写在AssemblyInfo.cs文件里均可以写出log文件来，大家可以试一试。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("paopaotang",199779,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(199779,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl18$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl18_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#199799">#20楼</a><a name="199799" id="comment_anchor_199799"></a>[<span class="louzhu">楼主</span>]
							
								2005-07-25 17:50
							
						<a id="Comments1_CommentList_ctl19_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_199799" class="blog_comment_body">to paopaotang:
<br>       谢谢你和大家分享你的心得！</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",199799,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(199799,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl19$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl19_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#203463">#21楼</a><a name="203463" id="comment_anchor_203463"></a>
							
								2005-07-30 13:31
							
						<a id="Comments1_CommentList_ctl20_NameLink" href="http://www.cnblogs.com/onlytiancai/" target="_top">蛙蛙池塘</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%9b%99%e8%9b%99%e6%b1%a0%e5%a1%98" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_203463" class="blog_comment_body">有用</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("蛙蛙池塘",203463,"3RTQ5uYDHYEfZetL7GJIMdz0JNpBakO2d8lIxiZgPaqpTUCzCWNtow==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(203463,"3RTQ5uYDHYEfZetL7GJIMdz0JNpBakO2d8lIxiZgPaqpTUCzCWNtow==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%9b%99%e8%9b%99%e6%b1%a0%e5%a1%98" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl20$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl20_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#232391">#22楼</a><a name="232391" id="comment_anchor_232391"></a>
							
								2005-09-08 12:39
							
						<a id="Comments1_CommentList_ctl21_NameLink" href="http://www.cnblogs.com/smalldust/" target="_top">smalldust</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/smalldust" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_232391" class="blog_comment_body">翻译作品？？
<br>原文是这个吧：
<br><a target="_new" href="http://www.ondotnet.com/lpt/a/3945">http://www.ondotnet.com/lpt/a/3945</a></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("smalldust",232391,"RR5Pi7/jBZ4u+ePLdXUaF2a5UOhAj9MtEgbUB4br2X9yqiTjgGn0xw==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(232391,"RR5Pi7/jBZ4u+ePLdXUaF2a5UOhAj9MtEgbUB4br2X9yqiTjgGn0xw==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=smalldust" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl21$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl21_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#233067">#23楼</a><a name="233067" id="comment_anchor_233067"></a>
							
								2005-09-09 10:50
							
						<a id="Comments1_CommentList_ctl22_NameLink" target="_blank">所罗门[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_233067" class="blog_comment_body">如果我在配置文件里不设定Appender的File，即删除了&lt;param name="File" value="log-file.txt" /&gt; 一行信息，我想要在程序运行时动态的设定log日志的文件名(例如以日期来作文件名)，该怎么处理才能实现
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("所罗门",233067,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(233067,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl22$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl22_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#234650">#24楼</a><a name="234650" id="comment_anchor_234650"></a>[<span class="louzhu">楼主</span>]
							
								2005-09-11 21:50
							
						<a id="Comments1_CommentList_ctl23_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_234650" class="blog_comment_body">@smalldust
<br>主要是翻译的这篇文章，在此基础上增加了少量的细节资料。后来贴出本文时再想找原文时却找不到出处了。
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",234650,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(234650,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl23$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl23_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#234652">#25楼</a><a name="234652" id="comment_anchor_234652"></a>[<span class="louzhu">楼主</span>]
							
								2005-09-11 21:52
							
						<a id="Comments1_CommentList_ctl24_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_234652" class="blog_comment_body">@所罗门
<br>我想应该可以用本文中3.3节"在程序中配置log4net "谈到的方法来实现吧。请原谅因为最近在赶项目，所以不能亲自试验一下。如果你成功了，别忘了来这里谈谈你的心得哦！</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",234652,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(234652,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl24$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl24_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#234941">#26楼</a><a name="234941" id="comment_anchor_234941"></a>
							
								2005-09-12 11:50
							
						<a id="Comments1_CommentList_ctl25_NameLink" target="_blank">张辉[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_234941" class="blog_comment_body">请问，如何在程序里设置文件名（路径+文件名）呢？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("张辉",234941,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(234941,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl25_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl25$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl25_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#235006">#27楼</a><a name="235006" id="comment_anchor_235006"></a>[<span class="louzhu">楼主</span>]
							
								2005-09-12 12:46
							
						<a id="Comments1_CommentList_ctl26_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_235006" class="blog_comment_body">@ 张辉
<br>我没试过，但是我想你把路径直接换成绝对路径也应该是可以的吧</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",235006,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(235006,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl26_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl26$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl26_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#263635">#28楼</a><a name="263635" id="comment_anchor_263635"></a>
							
								2005-10-28 10:35
							
						<a id="Comments1_CommentList_ctl27_NameLink" href="http://www.cnblogs.com/jiaoke/" target="_top">jiaoke</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/jiaoke" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_263635" class="blog_comment_body">我按照上面的来做,但是出现这个错误,是什么原因
<br>log4net:ERROR [FileAppender] Unable to acquire lock on file c:\inetpub\wwwroot\test2\log-file.txt. 对路径“c:\inetpub\wwwroot\test2\log-file.txt”的访问被拒绝。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("jiaoke",263635,"MTQftGLSXxgHSYQ3mlFlTOXo6mHqmhQJeE43tKpkfoiEUaLJS4VDrg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(263635,"MTQftGLSXxgHSYQ3mlFlTOXo6mHqmhQJeE43tKpkfoiEUaLJS4VDrg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=jiaoke" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl27_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl27$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl27_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#267111">#29楼</a><a name="267111" id="comment_anchor_267111"></a>[<span class="louzhu">楼主</span>]
							
								2005-11-02 13:43
							
						<a id="Comments1_CommentList_ctl28_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_267111" class="blog_comment_body">抱歉最近来的不勤，这个问题多半是因为ASP.NET这个帐户对该目录没有读写权限。我想你可以将Everyone的写权限加到该文件的安全设置中</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",267111,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(267111,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl28_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl28$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl28_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#269401">#30楼</a><a name="269401" id="comment_anchor_269401"></a>
							
								2005-11-05 11:03
							
						<a id="Comments1_CommentList_ctl29_NameLink" target="_blank">kali[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_269401" class="blog_comment_body">当我使用一个新的AppDomain来加载并执行dll(c# class)时发现里面的log4net都不起作用了(记不了日志了),只要主AppDomain里的log4net起作用
<br>但如果不用新的AppDomain来加载执行时dll里的log4net就能起作用(能记日志了)
<br>
<br>请问如何解决</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("kali",269401,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(269401,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl29_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl29$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl29_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#274188">#31楼</a><a name="274188" id="comment_anchor_274188"></a>
							
								2005-11-11 17:06
							
						<a id="Comments1_CommentList_ctl30_NameLink" target="_blank">nk912114[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_274188" class="blog_comment_body">log4net.Layout.XmlLayout xmlLayout = new log4net.Layout.XmlLayout();
<br>			xmlLayout.Header = "&lt;?xml version=\"1.0\" encoding=\"gb2312\" ?&gt; &lt;events&gt; " ;
<br>			xmlLayout.Footer = "&lt;/events&gt;" 
<br>怎么生成的xml日志文件中，总是没有"&lt;/events&gt;" 
<br>也就是说xmlLayout.Footer = "&lt;/events&gt;" 好像不起作用
<br>:'(
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("nk912114",274188,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(274188,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl30_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl30$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl30_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#274281">#32楼</a><a name="274281" id="comment_anchor_274281"></a>[<span class="louzhu">楼主</span>]
							
								2005-11-11 18:44
							
						<a id="Comments1_CommentList_ctl31_NameLink" href="http://www.cnblogs.com/dragon/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_274281" class="blog_comment_body">@kali ,
<br>        这个也许是因为多线程的缘故，你参考一下原文中提到的在多线程中应用Log4net的部分看看能不能解决问题。
<br>     <a target="_new" href="http://www.ondotnet.com/lpt/a/3945">http://www.ondotnet.com/lpt/a/3945</a>：Logging in a Multithreaded Application
<br>  
<br>@nk912114,
<br>       这个问题没有试过，暂时不知道什么原因，抱歉。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",274281,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(274281,"AcYOwTEY0BE0n2RJQg6wJ+JtAAGBwfiuWwp8kGgr32S6Nir2vwApkQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl31_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl31$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl31_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#281682">#33楼</a><a name="281682" id="comment_anchor_281682"></a>
							
								2005-11-21 23:34
							
						<a id="Comments1_CommentList_ctl32_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://xwx.narod.ru" target="_top">yujiaao[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_281682" class="blog_comment_body">好东西,谢谢好心人!</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("yujiaao",281682,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(281682,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl32_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl32$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl32_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#310680">#34楼</a><a name="310680" id="comment_anchor_310680"></a>
							
								2006-01-04 12:53
							
						<a id="Comments1_CommentList_ctl33_NameLink" target="_blank">zyl[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_310680" class="blog_comment_body">救星</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("zyl",310680,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(310680,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl33_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl33$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl33_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#329830">#35楼</a><a name="329830" id="comment_anchor_329830"></a>
							
								2006-02-13 17:34
							
						<a id="Comments1_CommentList_ctl34_NameLink" href="http://www.cnblogs.com/somecold/" target="_top">老家伙来挨踢</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%80%81%e5%ae%b6%e4%bc%99%e6%9d%a5%e6%8c%a8%e8%b8%a2" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_329830" class="blog_comment_body">谢谢提供的例子</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("老家伙来挨踢",329830,"APZo6QlUjRyMz3xfbFigH5CO9TxJgwoykiFTtQGvApbg3/dLcXoMOQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(329830,"APZo6QlUjRyMz3xfbFigH5CO9TxJgwoykiFTtQGvApbg3/dLcXoMOQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%80%81%e5%ae%b6%e4%bc%99%e6%9d%a5%e6%8c%a8%e8%b8%a2" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl34_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl34$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl34_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#559629">#36楼</a><a name="559629" id="comment_anchor_559629"></a>
							
								2006-11-13 20:35
							
						<a id="Comments1_CommentList_ctl35_NameLink" href="http://www.cnblogs.com/PeterWang/" target="_top">东吴居士</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%9c%e5%90%b4%e5%b1%85%e5%a3%ab" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_559629" class="blog_comment_body"> 请问
<br>　ADONetAppend中的连接字符串如果加密一下，log4会读出来吗，怎么解决？
<br>一时找不简单方法，除非改代码。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("东吴居士",559629,"bRkavopQmUddYx0g3RfArrJAfFe5rtFKCGuxq6WRWJpSDu2aKE4T6Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(559629,"bRkavopQmUddYx0g3RfArrJAfFe5rtFKCGuxq6WRWJpSDu2aKE4T6Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%9c%e5%90%b4%e5%b1%85%e5%a3%ab" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl35_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl35$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl35_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#569334">#37楼</a><a name="569334" id="comment_anchor_569334"></a>
							
								2006-11-23 05:11
							
						<a id="Comments1_CommentList_ctl36_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://admin@dotnetspace.com" target="_top">DotNetSpace[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_569334" class="blog_comment_body">Log4Net 实例:
<br>
<br><span><a href="http://www.dotnetspace.com/" class="smarterwiki-linkify">www.dotnetspace.com</a></span></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("DotNetSpace",569334,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(569334,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl36_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl36$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl36_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#569335">#38楼</a><a name="569335" id="comment_anchor_569335"></a>
							
								2006-11-23 05:12
							
						<a id="Comments1_CommentList_ctl37_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://admin@dotnetspace.com" target="_top">DotNetSpace[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_569335" class="blog_comment_body">
<br><a target="_new" href="http://www.dotnetspace.com/index.php?option=com_content&amp;task=view&amp;id=13">http://www.dotnetspace.com/index.php?option=com_content&amp;task=view&amp;id=13</a></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("DotNetSpace",569335,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(569335,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl37_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl37$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl37_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#582788">#39楼</a><a name="582788" id="comment_anchor_582788"></a>
							
								2006-12-05 14:05
							
						<a id="Comments1_CommentList_ctl38_NameLink" href="http://www.cnblogs.com/cmzzlh/" target="_top">公木子</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e5%85%ac%e6%9c%a8%e5%ad%90" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_582788" class="blog_comment_body">This example shows how to configure the file name to write to using an environment variable TMP. The encoding to use to write to the file is also specified. 
<br>
<br>&lt;appender name="FileAppender" type="log4net.Appender.FileAppender"&gt;
<br>	&lt;file value="${TMP}\log-file.txt" /&gt;
<br>	&lt;appendToFile value="true" /&gt;
<br>	&lt;encoding value="unicodeFFFE" /&gt;
<br>	&lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>		&lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&gt;
<br>	&lt;/layout&gt;
<br>&lt;/appender&gt;
<br>
<br>请问楼主知道这个${TMP}环境变量是哪里设置的吗？
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("公木子",582788,"KYUS+on54np4Zbca4YzsLXCw/DEjQlms866TPL9rjG5+X3K8d32qvg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(582788,"KYUS+on54np4Zbca4YzsLXCw/DEjQlms866TPL9rjG5+X3K8d32qvg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e5%85%ac%e6%9c%a8%e5%ad%90" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl38_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl38$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl38_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#582815">#40楼</a><a name="582815" id="comment_anchor_582815"></a>
							
								2006-12-05 14:24
							
						<a id="Comments1_CommentList_ctl39_NameLink" href="http://www.cnblogs.com/PeterWang/" target="_top">东吴居士</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%9c%e5%90%b4%e5%b1%85%e5%a3%ab" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_582815" class="blog_comment_body">windows enviroment setting?</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("东吴居士",582815,"bRkavopQmUddYx0g3RfArrJAfFe5rtFKCGuxq6WRWJpSDu2aKE4T6Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(582815,"bRkavopQmUddYx0g3RfArrJAfFe5rtFKCGuxq6WRWJpSDu2aKE4T6Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%9c%e5%90%b4%e5%b1%85%e5%a3%ab" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl39_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl39$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl39_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#584914">#41楼</a><a name="584914" id="comment_anchor_584914"></a>
							
								2006-12-07 09:29
							
						<a id="Comments1_CommentList_ctl40_NameLink" target="_blank">ZHENGBIN[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_584914" class="blog_comment_body">为何日志不能输出到oracle9i数据库中，是不是配置问题，请各位帮小弟看看阿：以下就是配置的主要部分
<br>&lt;!-- 日志文件输出oracle9i --&gt;
<br>		&lt;appender name="AdoNetAppender_Oracle" type="log4net.Appender.AdoNetAppender"&gt;
<br>        &lt;connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
<br>        &lt;connectionString value="data source=ZHENGBIN;User ID=CTRS;Password=CTRS" /&gt;
<br>        &lt;commandText value="INSERT INTO LOG (Datetime,Thread,Log_Level,Logger,Message) VALUES (:log_date, :thread, :log_level, :logger, :message)" /&gt;
<br>        &lt;bufferSize value="128" /&gt;
<br>        &lt;parameter&gt;
<br>		   &lt;parameterName value=":log_date" /&gt;
<br>		   &lt;dbType value="String" /&gt;
<br>		   &lt;size value="100" /&gt;
<br>		   &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>			&lt;conversionPattern value="%date" /&gt;
<br>		   &lt;/layout&gt;
<br>        &lt;/parameter&gt;
<br>        &lt;parameter&gt;
<br>		   &lt;parameterName value=":thread" /&gt;
<br>		   &lt;dbType value="String" /&gt;
<br>		   &lt;size value="255" /&gt;
<br>		   &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>			&lt;conversionPattern value="%thread" /&gt;
<br>		   &lt;/layout&gt;
<br>       &lt;/parameter&gt;
<br>       &lt;parameter&gt;
<br>		  &lt;pParameterName value=":log_level" /&gt;
<br>		  &lt;dbType value="String" /&gt;
<br>		  &lt;size value="255" /&gt;
<br>		  &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>			&lt;conversionPattern value="%level" /&gt;
<br>		  &lt;/layout&gt;
<br>       &lt;/parameter&gt;
<br>       &lt;parameter&gt;
<br>		  &lt;parameterName value=":logger" /&gt;
<br>		  &lt;dbType value="String" /&gt;
<br>		  &lt;size value="255" /&gt;
<br>		  &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>			&lt;conversionPattern value="%logger" /&gt;
<br>		  &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>		  &lt;parameterName value=":message" /&gt;
<br>		  &lt;dbType value="String" /&gt;
<br>		  &lt;size value="4000" /&gt;
<br>		  &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>			&lt;conversionPattern value="%message" /&gt;
<br>		  &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>     &lt;/appender&gt;</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("ZHENGBIN",584914,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(584914,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl40_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl40$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl40_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#601674">#42楼</a><a name="601674" id="comment_anchor_601674"></a>
							
								2006-12-23 19:53
							
						<a id="Comments1_CommentList_ctl41_NameLink" target="_blank">zxpwolf[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_601674" class="blog_comment_body">我想在一个exe程序中调用多个dll，而同时希望：
<br>1.不同的程序集能将日志输出到不同的日志文件中。
<br>2.如果没有日志配置文件，则程序中会调用代码配置(这一部分我是调用log4net.Config.BasicConfigurator.Configure（...）来实现的)。
<br>3.不同的程序集输出的时候，比如exe调用某一个dll之前，日志输入到exe的日志中，而调用dll时要把日志输入到dll的日志中。调用完dll返回exe时，exe的日志要继续输出到exe的日志中。
<br>
<br>现在的问题是，调用dll之前，exe日志能正常,调用dll之后，同一条日志信息，会同时输出两次，exe的日志文件一份，dll的日志文件一份。我使用了一个类用来对log4net.dll进行封装，返回的ILog对象我使用静态实例来保存，而输出日志接口也是静态的。
<br>
<br>请问问题该如何解决？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("zxpwolf",601674,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(601674,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl41_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl41$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl41_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#630473">#43楼</a><a name="630473" id="comment_anchor_630473"></a>
							
								2007-01-25 17:10
							
						<a id="Comments1_CommentList_ctl42_NameLink" target="_blank">aa[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_630473" class="blog_comment_body">@公木子
<br>我也想知道这个问题，你解决了吗？能告诉我吗?谢谢</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("aa",630473,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(630473,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl42_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl42$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl42_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#673073">#44楼</a><a name="673073" id="comment_anchor_673073"></a>
							
								2007-03-13 14:09
							
						<a id="Comments1_CommentList_ctl43_NameLink" target="_blank">flowstar[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_673073" class="blog_comment_body">请问楼主，如何实现系统错误日志保存到表1中，而系统操作日志保存到表2中的需求?
<br>以下是我想到的解决办法，可是log4net的处理结果是在两个表中保存了同样的信息。望赐教
<br>&lt;log4net&gt; 
<br>		&lt;root&gt; 
<br>			&lt;level value="ALL" /&gt; 
<br>			&lt;appender-ref ref="ADONetAppender" /&gt;
<br>			&lt;appender-ref ref="ADONetAppender2" /&gt;
<br>		&lt;/root&gt; 
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("flowstar",673073,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(673073,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl43_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl43$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl43_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#673486">#45楼</a><a name="673486" id="comment_anchor_673486"></a>
							
								2007-03-13 18:58
							
						<a id="Comments1_CommentList_ctl44_NameLink" target="_blank">flowstar[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_673486" class="blog_comment_body">再请教一个问题
<br>我的数据库访问字串，不想写到配置文件中，可否硬编码到程序中，我们的项目是winform，主要考虑到安全问题。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("flowstar",673486,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(673486,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl44_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl44$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl44_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#679885">#46楼</a><a name="679885" id="comment_anchor_679885"></a>
							
								2007-03-19 14:53
							
						<a id="Comments1_CommentList_ctl45_NameLink" target="_blank">simen[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_679885" class="blog_comment_body">老大：
<br>   我想请问一下，log4net-1.2.10，在VB.net里面(winform)，AssemblyInfo.vb里怎么写配置代码？
<br>   我这样写，&lt;assembly:log4net.Config.XmlConfigurator(ConfigFile="Log4Config.xml",Watch=true)&gt;，却提示出错。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("simen",679885,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(679885,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl45_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl45$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl45_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#807641">#47楼</a><a name="807641" id="comment_anchor_807641"></a>
							
								2007-07-05 21:08
							
						<a id="Comments1_CommentList_ctl46_NameLink" target="_blank">兜兜[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_807641" class="blog_comment_body">@paopaotang
<br>救命呀，我在WebService中按步骤引用了log4net,可是总是写不出日志文件，而且log.isdebugenable属性总为false,而我所有的优先级明明设的都是All，但是在WindowsForm下边同样的操作就可以写出日志文件，为什么呀 </span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("兜兜",807641,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(807641,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl46_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl46$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl46_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#811327">#48楼</a><a name="811327" id="comment_anchor_811327"></a>
							
								2007-07-09 15:52
							
						<a id="Comments1_CommentList_ctl47_NameLink" target="_blank">Freeman[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_811327" class="blog_comment_body">@所罗门
<br>如果我在配置文件里不设定Appender的File，即删除了&lt;param name="File" value="log-file.txt" /&gt; 一行信息，我想要在程序运行时动态的设定log日志的文件名(例如以日期来作文件名)，该怎么处理才能实现 
<br>
<br>现在的log4net中只有RollingFileAppender，我感觉最好是自己写一个DailyFileAppender，来实现每天输出一个日志的功能，其实，只要在RollingFileAppender的基础上稍微改一点就可以了。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("Freeman",811327,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(811327,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl47_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl47$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl47_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#825020">#49楼</a><a name="825020" id="comment_anchor_825020"></a>
							
								2007-07-20 09:49
							
						<a id="Comments1_CommentList_ctl48_NameLink" href="http://www.cnblogs.com/wanlang/" target="_top">万朗</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%b8%87%e6%9c%97" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_825020" class="blog_comment_body">楼主的文章有用,支持!</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("万朗",825020,"UkLwcLlmEBVBE13szNsJ0CcWGDbH5JQJhXj6c4IR8M5yKyibdlie5Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(825020,"UkLwcLlmEBVBE13szNsJ0CcWGDbH5JQJhXj6c4IR8M5yKyibdlie5Q==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%b8%87%e6%9c%97" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl48_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl48$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl48_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#868094">#50楼</a><a name="868094" id="comment_anchor_868094"></a>
							
								2007-08-24 11:44
							
						<a id="Comments1_CommentList_ctl49_NameLink" href="http://www.cnblogs.com/cigarxu/" target="_top">cigar_xu</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/cigar_xu" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_868094" class="blog_comment_body">博主，能不能幫我看看下面錯誤是什么原因造成的啊。
<br>
<br>Server Error in '/WebServiceClient' Application.
<br>--------------------------------------------------------------------------------
<br>
<br>Configuration Error 
<br>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 
<br>
<br>Parser Error Message: Access is denied: 'log4net'.
<br>
<br>Source Error: 
<br>
<br>
<br>Line 196:				&lt;add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
<br>Line 197:				&lt;add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&gt;
<br>Line 198:				&lt;add assembly="*"/&gt;
<br>Line 199:			&lt;/assemblies&gt;
<br>Line 200:		&lt;/compilation&gt;
<br> 
<br>
<br>Source File: c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config    Line: 198 
<br>
<br>Assembly Load Trace: The following information can be helpful to determine why the assembly 'log4net' could not be loaded.
<br>
<br>
<br>=== Pre-bind state information ===
<br>LOG: DisplayName = log4net
<br> (Partial)
<br><span>LOG: Appbase = <a href="file:///c:/inetpub/wwwroot/WebServiceClient" class="smarterwiki-linkify">file:///c:/inetpub/wwwroot/WebServiceClient</a>
</span><br>LOG: Initial PrivatePath = bin
<br>Calling assembly : (Unknown).
<br>===
<br>
<br>LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
<br>LOG: Post-policy reference: log4net
<br><span>LOG: Attempting download of new URL <a href="file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary" class="smarterwiki-linkify">file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary</a> ASP.NET Files/webserviceclient/fac2c58b/3b3c9de7/log4net.DLL.
</span><br><span>LOG: Attempting download of new URL <a href="file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary" class="smarterwiki-linkify">file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary</a> ASP.NET Files/webserviceclient/fac2c58b/3b3c9de7/log4net/log4net.DLL.
</span><br><span>LOG: Attempting download of new URL <a href="file:///c:/inetpub/wwwroot/WebServiceClient/bin/log4net.DLL" class="smarterwiki-linkify">file:///c:/inetpub/wwwroot/WebServiceClient/bin/log4net.DLL</a>.
</span><br>LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
<br>LOG: Post-policy reference: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=null
<br>
<br> 
<br>
<br>
<br>--------------------------------------------------------------------------------
<br>Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 
<br>
<br>注：我是在Asp.net web services中使用log4net，而且在assembly.cs文件中也有把log4net.Config.XMLConfiguratorAttribute加進來。更為奇怪的是這個錯誤有可能在某個時候又自己好了，但有不知道下次會發生在什么時候，確實很苦惱。
<br>
<br>請各位碰到過類似問題的幫忙解決以下哈，謝謝各位了。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("cigar_xu",868094,"k0xqmfx1CwfKuARbosV7TEPBMn//DZrhJgDWQplXiQnjAOxlkiQcpQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(868094,"k0xqmfx1CwfKuARbosV7TEPBMn//DZrhJgDWQplXiQnjAOxlkiQcpQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=cigar_xu" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl49_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl49$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl49_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#886592">#51楼</a><a name="886592" id="comment_anchor_886592"></a>
							
								2007-09-08 12:04
							
						<a id="Comments1_CommentList_ctl50_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.nb-yupao.com" target="_top">yupao[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_886592" class="blog_comment_body">不错,学习了</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("yupao",886592,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(886592,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl50_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl50$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl50_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#952847">#52楼</a><a name="952847" id="comment_anchor_952847"></a>
							
								2007-11-08 09:04
							
						<a id="Comments1_CommentList_ctl51_NameLink" href="http://www.cnblogs.com/lsmsky/" target="_top">雁过无声</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%9b%81%e8%bf%87%e6%97%a0%e5%a3%b0" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_952847" class="blog_comment_body">如要我要把日志记录在数据库中要如何配置哟。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("雁过无声",952847,"/5JHCasisO1oaNMszXoyjxueMHEdpz61iiZFjm2GBApLNgVh4wFv7w==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(952847,"/5JHCasisO1oaNMszXoyjxueMHEdpz61iiZFjm2GBApLNgVh4wFv7w==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%9b%81%e8%bf%87%e6%97%a0%e5%a3%b0" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl51_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl51$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl51_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#954249">#53楼</a><a name="954249" id="comment_anchor_954249"></a>
							
								2007-11-09 13:15
							
						<a id="Comments1_CommentList_ctl52_NameLink" href="http://www.cnblogs.com/3zfp/" target="_top">zfphere</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/zfphere" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_954249" class="blog_comment_body">@雁过无声
<br>自己扩展Appender</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("zfphere",954249,"uBX73PJ9rlIRrltRxbNzslrr5HhwrNQDu6htbRr3dbnSo6w4l8R90g==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(954249,"uBX73PJ9rlIRrltRxbNzslrr5HhwrNQDu6htbRr3dbnSo6w4l8R90g==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=zfphere" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl52_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl52$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl52_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1044456">#54楼</a><a name="1044456" id="comment_anchor_1044456"></a>
							
								2008-01-18 15:02
							
						<a id="Comments1_CommentList_ctl53_NameLink" target="_blank">darrrkness[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1044456" class="blog_comment_body">@Freeman （#51楼）
<br>不用自己实现，RollingFileAppender已经有这个功能，用 RollingStyle 和 DatePattern 来配置，示例配置如下（日志文件名类似log20080101，log20080102...）：
<br>... ...
<br>    &lt;appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" &gt;
<br>      &lt;param name="File" type="" value="log" /&gt;
<br>      &lt;param name="AppendToFile" value="true" /&gt;
<br>      &lt;param name="RollingStyle" value="Date" /&gt;
<br>      &lt;param name="DatePattern" value="yyyyMMdd" /&gt;
<br>      &lt;param name="StaticLogFileName" value="false" /&gt;
<br>      &lt;layout type="log4net.Layout.PatternLayout,log4net"&gt;
<br>        &lt;param name="ConversionPattern" value="%d [%t] %-5p %-10c - %m%n" /&gt;
<br>        &lt;param name="Header" value="----------------------header--------------------------
<br>" /&gt;
<br>        &lt;param name="Footer" value="----------------------footer--------------------------
<br>" /&gt;
<br>      &lt;/layout&gt;
<br>    &lt;/appender&gt;
<br>... ...</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("darrrkness",1044456,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1044456,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl53_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl53$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl53_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1044467">#55楼</a><a name="1044467" id="comment_anchor_1044467"></a>
							
								2008-01-18 15:10
							
						<a id="Comments1_CommentList_ctl54_NameLink" target="_blank">darrrkness[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1044467" class="blog_comment_body">@雁过无声 （#56楼）
<br>用AdoNetAppender就可以，具体要看是什么数据库，MS SQL的配置示例如下（其他的可以参考log4net官方的示例：<a href="http://logging.apache.org/log4net/release/config-examples.html" target="_new" rel="nofollow">http://logging.apache.org/log4net/release/config-examples.html</a>）：
<br>... ...
<br>    &lt;appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender,log4net"&gt;
<br>      &lt;bufferSize value="100" /&gt;
<br>      &lt;connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
<br>      &lt;connectionString value="data source=(local)\denggang;initial catalog=CKOAS_online;integrated security=false;persist security info=True;User ID=sa;Password=symantec" /&gt;
<br>      &lt;commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" /&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@log_date" /&gt;
<br>        &lt;dbType value="DateTime" /&gt;
<br>        &lt;layout type="log4net.Layout.RawTimeStampLayout" /&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@thread" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="255" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%thread" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@log_level" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="50" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%level" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@logger" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="255" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%logger" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@message" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%message" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@exception" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="2000" /&gt;
<br>        &lt;layout type="log4net.Layout.ExceptionLayout" /&gt;
<br>      &lt;/parameter&gt;
<br>    &lt;/appender&gt;
<br>... ...
<br>对了，补上生成数据表的脚本：
<br>CREATE TABLE [dbo].[Log] (
<br>    [Id] [int] IDENTITY (1, 1) NOT NULL,
<br>    [Date] [datetime] NOT NULL,
<br>    [Thread] [varchar] (255) NOT NULL,
<br>    [Level] [varchar] (50) NOT NULL,
<br>    [Logger] [varchar] (255) NOT NULL,
<br>    [Message] [varchar] (4000) NOT NULL,
<br>    [Exception] [varchar] (2000) NULL
<br>)
<br>
<br>如果你看了log4net的示例页，就知道我只是抄过来的：P </span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("darrrkness",1044467,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1044467,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl54_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl54$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl54_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1052783">#56楼</a><a name="1052783" id="comment_anchor_1052783"></a>
							
								2008-01-25 11:27
							
						<a id="Comments1_CommentList_ctl55_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.jrgz2008.com" target="_top">今日关注[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1052783" class="blog_comment_body">收藏了先.谢谢</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("今日关注",1052783,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1052783,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl55_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl55$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl55_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1148252">#57楼</a><a name="1148252" id="comment_anchor_1148252"></a>
							
								2008-04-11 12:47
							
						<a id="Comments1_CommentList_ctl56_NameLink" target="_blank">Sgci_Violence[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1148252" class="blog_comment_body">asp.net 2.0 使用log4net的方法
<br>注意了:时间插入有问题.这里要用String格试才行.
<br>这个原因暂时还没有找到.
<br>使用最新的log4net.dll (1.2.10)
<br>
<br>CREATE TABLE [Log2] (
<br>    ID   AutoIncrement,
<br>    [Date] longText,
<br>    [Thread] longText,
<br>    [Level] longText,
<br>    [Logger] longText,
<br>    [Message] longText,
<br>    [Exception] longText,
<br>    Primary   Key   (ID)
<br>)
<br>
<br>在Global.asax文件里:Global.asax
<br>    void Application_Start(object sender, EventArgs e) 
<br>    {
<br>        // 在应用程序启动时运行的代码
<br>       log4net.Config.DOMConfigurator.Configure(new System.IO.FileInfo(Server.MapPath("log4netConfig.xml")));
<br>    }
<br>
<br>下面是:log4netConfig.xml的文件内容大小:
<br>
<br>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
<br>&lt;configuration&gt;
<br>  &lt;configSections&gt;
<br>    &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.0"/&gt;
<br>  &lt;/configSections&gt;
<br>  &lt;log4net&gt;
<br>    &lt;root&gt;
<br>      &lt;level value="ALL" /&gt;
<br>      &lt;appender-ref ref="AdoNetAppender" /&gt;
<br>    &lt;/root&gt;
<br>    &lt;appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender"&gt;
<br>      &lt;bufferSize value="0" /&gt;
<br>      &lt;connectionString value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\db1.mdb;"  /&gt;
<br>      &lt;commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date,@thread, @log_level, @logger, @message,@exception)" /&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@log_date" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%date" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@thread" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%thread" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@log_level" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%level" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@logger" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%logger" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@message" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.PatternLayout"&gt;
<br>          &lt;conversionPattern value="%message" /&gt;
<br>        &lt;/layout&gt;
<br>      &lt;/parameter&gt;
<br>      &lt;parameter&gt;
<br>        &lt;parameterName value="@exception" /&gt;
<br>        &lt;dbType value="String" /&gt;
<br>        &lt;size value="4000" /&gt;
<br>        &lt;layout type="log4net.Layout.ExceptionLayout" /&gt;
<br>      &lt;/parameter&gt;
<br>    &lt;/appender&gt;
<br>  &lt;/log4net&gt;
<br>  &lt;/configuration&gt;
<br>                    
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("Sgci_Violence",1148252,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1148252,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl56_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl56$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl56_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1178378">#58楼</a><a name="1178378" id="comment_anchor_1178378"></a>
							
								2008-05-01 07:20
							
						<a id="Comments1_CommentList_ctl57_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.svnhost.cn" target="_top">SVN开源社区[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1178378" class="blog_comment_body">学习</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("SVN开源社区",1178378,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1178378,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl57_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl57$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl57_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1222192">#59楼</a><a name="1222192" id="comment_anchor_1222192"></a>
							
								2008-06-10 15:22
							
						<a id="Comments1_CommentList_ctl58_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.3wdotec.com" target="_top">eitrade[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1222192" class="blog_comment_body">不错...</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("eitrade",1222192,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1222192,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl58_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl58$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl58_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1222193">#60楼</a><a name="1222193" id="comment_anchor_1222193"></a>
							
								2008-06-10 15:23
							
						<a id="Comments1_CommentList_ctl59_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.higreenbag.com" target="_top">环保袋[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1222193" class="blog_comment_body">学习了...</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("环保袋",1222193,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1222193,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl59_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl59$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl59_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1222196">#61楼</a><a name="1222196" id="comment_anchor_1222196"></a>
							
								2008-06-10 15:24
							
						<a id="Comments1_CommentList_ctl60_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.eitrade.com" target="_top">textile[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1222196" class="blog_comment_body">真热闹</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("textile",1222196,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1222196,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl60_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl60$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl60_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1222197">#62楼</a><a name="1222197" id="comment_anchor_1222197"></a>
							
								2008-06-10 15:25
							
						<a id="Comments1_CommentList_ctl61_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.renkui.com" target="_top">china suppliers[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1222197" class="blog_comment_body">Server Error in '/WebServiceClient' Application. 
<br>-------------------------------------------------------------------------------- 
<br>
<br>Configuration Error 
<br>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 
<br>
<br>Parser Error Message: Access is denied: 'log4net'. 
<br>
<br>Source Error: 
<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("china suppliers",1222197,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1222197,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl61_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl61$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl61_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1226894">#63楼</a><a name="1226894" id="comment_anchor_1226894"></a>
							
								2008-06-16 10:20
							
						<a id="Comments1_CommentList_ctl62_NameLink" target="_blank">赵赫[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1226894" class="blog_comment_body">不错。一篇文章3年更新。楼主精神可嘉。
<br>能不能发篇完整的能运行的代码看看。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("赵赫",1226894,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1226894,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl62_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl62$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl62_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1233258">#64楼</a><a name="1233258" id="comment_anchor_1233258"></a>
							
								2008-06-23 11:11
							
						<a id="Comments1_CommentList_ctl63_NameLink" href="http://www.cnblogs.com/anya/" target="_top">anya</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/anya" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1233258" class="blog_comment_body">我写完日志后，用记事本打开时提示要重新加载，和另一个程序正在使用此文件，进程无法访问。不关闭程序。怎样用记事本打开。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("anya",1233258,"QDbhWq0eeF0dTnSrQ1wdAnFvrQUuwsLIUC8kFSfRvfnEM2EDmzh0kQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1233258,"QDbhWq0eeF0dTnSrQ1wdAnFvrQUuwsLIUC8kFSfRvfnEM2EDmzh0kQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=anya" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl63_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl63$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl63_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1253810">#65楼</a><a name="1253810" id="comment_anchor_1253810"></a>
							
								2008-07-14 11:25
							
						<a id="Comments1_CommentList_ctl64_NameLink" href="http://www.cnblogs.com/lifekiller/" target="_top">LifeKiller</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/LifeKiller" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1253810" class="blog_comment_body">问一下如果是多层的web application，log4net该放在哪一层？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("LifeKiller",1253810,"8h5P/ZZ47CD4nJ0zWH9Y/EHYPzj1m6ZYUyGM6IPAu9TMGvZnwumfHQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1253810,"8h5P/ZZ47CD4nJ0zWH9Y/EHYPzj1m6ZYUyGM6IPAu9TMGvZnwumfHQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=LifeKiller" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl64_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl64$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl64_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1279504">#66楼</a><a name="1279504" id="comment_anchor_1279504"></a>
							
								2008-08-06 14:06
							
						<a id="Comments1_CommentList_ctl65_NameLink" target="_blank">yu555[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1279504" class="blog_comment_body">不错，谢谢</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("yu555",1279504,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1279504,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl65_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl65$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl65_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1301415">#67楼</a><a name="1301415" id="comment_anchor_1301415"></a>
							
								2008-08-29 09:44
							
						<a id="Comments1_CommentList_ctl66_NameLink" target="_blank">xiaoqiang[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1301415" class="blog_comment_body">请问,我配置好了,也能用了，但是只能在根目录使用后,其他目录才可以使用,直接在其他目录使用,不可以,这是什么原因那?</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("xiaoqiang",1301415,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1301415,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl66_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl66$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl66_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1366652">#68楼</a><a name="1366652" id="comment_anchor_1366652"></a>
							
								2008-11-11 10:39
							
						<a id="Comments1_CommentList_ctl67_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://no" target="_top">qqhong[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1366652" class="blog_comment_body">vs2003 我用过 log4net 可以的。但是好像在 vs2008 中没办法用啊</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("qqhong",1366652,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1366652,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl67_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl67$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl67_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1402923">#69楼</a><a name="1402923" id="comment_anchor_1402923"></a>
							
								2008-12-15 18:08
							
						<a id="Comments1_CommentList_ctl68_NameLink" target="_blank">jonn'rose[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1402923" class="blog_comment_body">使用log4net可以对数据库或者应用程序的运行性能得到监控和反馈吗?</span>
						<br>
						&nbsp;&nbsp;<a onclick="ReplyComment(&quot;jonn'rose&quot;,1402923,&quot;&quot;)" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1402923,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl68_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl68$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl68_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1438041">#70楼</a><a name="1438041" id="comment_anchor_1438041"></a>
							
								2009-01-24 23:31
							
						<a id="Comments1_CommentList_ctl69_NameLink" target="_blank">sm375[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1438041" class="blog_comment_body">正在给公司开发一个类似于log4net的程序，因为我去年10月才第一次开始接触.net的东西，所有的一切都毫无概念。这个项目磕磕绊绊干到了1月初才大体完成，早知道楼主有这么好的文章就省了我的大麻烦。不过现在也不晚，有了自己摸索的过程，再看楼主的文章，醍醐灌顶。真的非常的感谢！<br><br>祝楼主以及各位，新春快乐！</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sm375",1438041,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1438041,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl69_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl69$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl69_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1438172">#71楼</a><a name="1438172" id="comment_anchor_1438172"></a>
							
								2009-01-25 22:40
							
						<a id="Comments1_CommentList_ctl70_NameLink" href="http://www.cnblogs.com/sema/" target="_top">sema</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/sema" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1438172" class="blog_comment_body">这说明在自己项目或研究前站在别人的肩膀上是多么重要啦，呵呵！</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("sema",1438172,"zry95nDHhxXzWv4gPSlQh5DdRw58PiRfScMdI6Y8GzadS1ZnRoB1mg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1438172,"zry95nDHhxXzWv4gPSlQh5DdRw58PiRfScMdI6Y8GzadS1ZnRoB1mg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=sema" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl70_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl70$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl70_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1452362">#72楼</a><a name="1452362" id="comment_anchor_1452362"></a>
							
								2009-02-16 13:18
							
						<a id="Comments1_CommentList_ctl71_NameLink" target="_blank">good[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1452362" class="blog_comment_body">不错，正需要，谢谢</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("good",1452362,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1452362,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl71_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl71$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl71_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1454226">#73楼</a><a name="1454226" id="comment_anchor_1454226"></a>
							
								2009-02-17 22:06
							
						<a id="Comments1_CommentList_ctl72_NameLink" href="http://www.cnblogs.com/jevons/" target="_top">风之旖旎</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%a3%8e%e4%b9%8b%e6%97%96%e6%97%8e" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1454226" class="blog_comment_body">一直想学这个东西，谢谢楼主了</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("风之旖旎",1454226,"hmdyufNG1/Jrv4ScNpNFYgd6XrUzotOhu0s1JoPjVOWwzajjXYxmBg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1454226,"hmdyufNG1/Jrv4ScNpNFYgd6XrUzotOhu0s1JoPjVOWwzajjXYxmBg==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%a3%8e%e4%b9%8b%e6%97%96%e6%97%8e" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl72_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl72$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl72_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1463061">#74楼</a><a name="1463061" id="comment_anchor_1463061"></a>
							
								2009-02-27 13:43
							
						<a id="Comments1_CommentList_ctl73_NameLink" href="http://www.cnblogs.com/chqyang/" target="_top">chqyang</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/chqyang" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1463061" class="blog_comment_body">在一个解决方案中的单元测试项目 按照你说的一些方法 配置后 还是写不出日志啊 在WEB应用程序中可以 郁闷</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("chqyang",1463061,"X5AhqAsJI8fbJRrfgANwPGq+ZYqapBjIfaM739SiU6Dr/dPaP8mTwA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1463061,"X5AhqAsJI8fbJRrfgANwPGq+ZYqapBjIfaM739SiU6Dr/dPaP8mTwA==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=chqyang" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl73_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl73$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl73_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1474953">#75楼</a><a name="1474953" id="comment_anchor_1474953"></a>
							
								2009-03-12 14:26
							
						<a id="Comments1_CommentList_ctl74_NameLink" href="http://space.cnblogs.com/53746/" target="_top">yezilsora</a>
					</div>
					<div class="postText">
						<span id="comment_body_1474953" class="blog_comment_body">郁闷一天了，能否请搂住提示一下下面的代码为何写不出日志呢。。。。
<br>①log4net.config文件
<br>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
<br>&lt;configuration&gt; 
<br>  &lt;configSections&gt; 
<br>    &lt;section name="log4net" 
<br>      type="log4net.Config.Log4NetConfigurationSectionHandler, log4net-net-1.0" 
<br>    /&gt; 
<br>  &lt;/configSections&gt; 
<br>
<br>  &lt;log4net&gt; 
<br>    &lt;root&gt; 
<br>      &lt;level value="ALL" /&gt; 
<br>      &lt;appender-ref ref="LogFileAppender" /&gt; 
<br>    &lt;/root&gt;   
<br>
<br>    &lt;appender name="LogFileAppender" type="log4net.Appender.FileAppender" &gt; 
<br>      &lt;param name="File" value="log.txt" /&gt; 
<br>      &lt;param name="AppendToFile" value="true" /&gt;
<br>      &lt;layout type="log4net.Layout.PatternLayout"&gt; 
<br>        &lt;param name="Footer" value="[Footer]\r\n"/--&gt; 
<br>        &lt;param name="ConversionPattern" value="%d [%t] %-5p %c [%x]  - %m%n" /&gt; 
<br>      &lt;/layout&gt; 
<br>    &lt;/appender&gt; 
<br>  &lt;/log4net&gt; 
<br>&lt;/configuration&gt; 
<br>
<br>②AssemblyInfo.cs文件中追加
<br>[assembly: log4net.Config.XmlConfigurator(ConfigFile="log4net.config", Watch=true)]
<br>
<br>③执行语句
<br>log4net.ILog log = log4net.LogManager.GetLogger("MyLogger");
<br>log.Debug("hello");</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("yezilsora",1474953,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1474953,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl74_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl74$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl74_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1475872">#76楼</a><a name="1475872" id="comment_anchor_1475872"></a>
							
								2009-03-13 11:39
							
						<a id="Comments1_CommentList_ctl75_NameLink" target="_blank">匿名[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1475872" class="blog_comment_body">大侠  ：问一下，log4net可不可以把日志搞成中文的啊，还有就是log4net可以设置记录所有操作不？？（eg.程序读取数据，修改数据，删除数据，系统启动等操作日志，运行日志）</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("匿名",1475872,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1475872,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl75_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl75$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl75_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1505836">#77楼</a><a name="1505836" id="comment_anchor_1505836"></a>
							
								2009-04-17 17:33
							
						<a id="Comments1_CommentList_ctl76_NameLink" href="http://www.cnblogs.com/purplefox2008/" target="_top">追忆似水流年</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%bf%bd%e5%bf%86%e4%bc%bc%e6%b0%b4%e6%b5%81%e5%b9%b4" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1505836" class="blog_comment_body">不錯，值得學習</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("追忆似水流年",1505836,"AJzKbDes6wN29VQDIHdUUDhAvWjwrPCbHUI2E7xHsUexGZ1gIkD2ng==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1505836,"AJzKbDes6wN29VQDIHdUUDhAvWjwrPCbHUI2E7xHsUexGZ1gIkD2ng==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%bf%bd%e5%bf%86%e4%bc%bc%e6%b0%b4%e6%b5%81%e5%b9%b4" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl76_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl76$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl76_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1505966">#78楼</a><a name="1505966" id="comment_anchor_1505966"></a>
							
								2009-04-17 21:10
							
						<a id="Comments1_CommentList_ctl77_NameLink" href="http://www.cnblogs.com/purplefox2008/" target="_top">追忆似水流年</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%bf%bd%e5%bf%86%e4%bc%bc%e6%b0%b4%e6%b5%81%e5%b9%b4" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1505966" class="blog_comment_body">這個的確是記錄錯誤，查找程序BUG的好方法，Mark！</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("追忆似水流年",1505966,"AJzKbDes6wN29VQDIHdUUDhAvWjwrPCbHUI2E7xHsUexGZ1gIkD2ng==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1505966,"AJzKbDes6wN29VQDIHdUUDhAvWjwrPCbHUI2E7xHsUexGZ1gIkD2ng==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%bf%bd%e5%bf%86%e4%bc%bc%e6%b0%b4%e6%b5%81%e5%b9%b4" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl77_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl77$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl77_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1562703">#79楼</a><a name="1562703" id="comment_anchor_1562703"></a>
							
								2009-06-19 15:47
							
						<a id="Comments1_CommentList_ctl78_NameLink" href="http://www.cnblogs.com/wn17173/" target="_top">付庭伟</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%bb%98%e5%ba%ad%e4%bc%9f" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1562703" class="blog_comment_body">我是按照你的步骤来的，可是为什么生成不了日志呢？急用，能帮我看看吗？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("付庭伟",1562703,"AT+FbNVm9eQwdZa7LFNIoJqF9fVPAQ50lV+JsYlzuPh1t9rpBFeJHQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1562703,"AT+FbNVm9eQwdZa7LFNIoJqF9fVPAQ50lV+JsYlzuPh1t9rpBFeJHQ==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%bb%98%e5%ba%ad%e4%bc%9f" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl78_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl78$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl78_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1585191">#80楼</a><a name="1585191" id="comment_anchor_1585191"></a>
							
								2009-07-15 11:41
							
						<a id="Comments1_CommentList_ctl79_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://www.87cool.com" target="_top">小顥[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1585191" class="blog_comment_body">你好~請問一下:<br>Error 2 Could not load file or assembly 'log4net' or one of its dependencies. 存取被拒。是什麼問題呀??我已經將寫的權限都打開了,還是不行~~!	<br></span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("小顥",1585191,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1585191,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl79_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl79$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl79_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1599081">#81楼</a><a name="1599081" id="comment_anchor_1599081"></a>
							
								2009-07-29 16:08
							
						<a id="Comments1_CommentList_ctl80_NameLink" href="http://www.cnblogs.com/xxyan/" target="_top">AK47</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/AK47" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1599081" class="blog_comment_body">很好。</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("AK47",1599081,"heU/xS6szeckvlFZVXSMLYdEgvuDdhXLgdzVeSPFw1imfM72uS8V/w==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1599081,"heU/xS6szeckvlFZVXSMLYdEgvuDdhXLgdzVeSPFw1imfM72uS8V/w==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=AK47" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl80_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl80$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl80_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1604580">#82楼</a><a name="1604580" id="comment_anchor_1604580"></a>
							
								2009-08-04 10:17
							
						<a id="Comments1_CommentList_ctl81_NameLink" href="http://www.cnblogs.com/wellsoho/" target="_top">狼狼</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%8b%bc%e7%8b%bc" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
					<div class="postText">
						<span id="comment_body_1604580" class="blog_comment_body">zan yi ge </span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("狼狼",1604580,"XVYr6WFFMKKvDfa05IfcAAic42iKBL28RqyFR1b/vGlOoYQtHl6JIw==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1604580,"XVYr6WFFMKKvDfa05IfcAAic42iKBL28RqyFR1b/vGlOoYQtHl6JIw==")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%8b%bc%e7%8b%bc" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl81_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl81$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl81_EditLink"></a>
					</div>
				</div>
				<br>
			
				<div class="post">			
					<div class="postTitle">
						<a href="#1694173">#83楼</a><a name="1694173" id="comment_anchor_1694173"></a><a name="Post"></a>
							
								2009-11-10 14:24
							
						<a id="Comments1_CommentList_ctl82_NameLink" target="_blank">yjh[未注册用户]</a>
					</div>
					<div class="postText">
						<span id="comment_body_1694173" class="blog_comment_body">很好的文章，能够持续更新3年多真是很不容易啊！！<br>我也想请教个问题：<br>[在程序中配置log4net ]<br>需要在程序中的哪个地方添加log4net的配置啊？</span>
						<br>
						&nbsp;&nbsp;<a onclick='ReplyComment("yjh",1694173,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1694173,"")' href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.aspx#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl82_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl82$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl82_EditLink"></a>
					</div>
				</div>
				<br>
			
</div>




				
</div>
<div id="lefttemp" style="display: none;">

	    <table id="Calendar1_entryCal" class="Cal" title="Calendar" style="border-style: solid; border-width: 1px; border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr><td colspan="7" style="background-color: Silver;"><table class="CalTitle" style="width: 100%; border-collapse: collapse;" border="0" cellspacing="0">
		<tbody><tr><td class="CalNextPrev" style="width: 15%;"><a href="javascript:__doPostBack('Calendar1$entryCal','V3622')" style="color: Black;" title="Go to the previous month">&lt;</a></td><td style="width: 70%;" align="center">2010年1月</td><td class="CalNextPrev" style="width: 15%;" align="right"><a href="javascript:__doPostBack('Calendar1$entryCal','V3684')" style="color: Black;" title="Go to the next month">&gt;</a></td></tr>
	</tbody></table></td></tr><tr><th class="CalDayHeader" abbr="日" scope="col" align="center">日</th><th class="CalDayHeader" abbr="一" scope="col" align="center">一</th><th class="CalDayHeader" abbr="二" scope="col" align="center">二</th><th class="CalDayHeader" abbr="三" scope="col" align="center">三</th><th class="CalDayHeader" abbr="四" scope="col" align="center">四</th><th class="CalDayHeader" abbr="五" scope="col" align="center">五</th><th class="CalDayHeader" abbr="六" scope="col" align="center">六</th></tr><tr><td class="CalOtherMonthDay" style="width: 14%;" align="center">27</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">28</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">29</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">30</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">31</td><td style="width: 14%;" align="center">1</td><td class="CalWeekendDay" style="width: 14%;" align="center">2</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">3</td><td style="width: 14%;" align="center">4</td><td style="width: 14%;" align="center">5</td><td style="width: 14%;" align="center">6</td><td style="width: 14%;" align="center">7</td><td style="width: 14%;" align="center">8</td><td class="CalWeekendDay" style="width: 14%;" align="center">9</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">10</td><td style="width: 14%;" align="center">11</td><td style="width: 14%;" align="center">12</td><td style="width: 14%;" align="center">13</td><td style="width: 14%;" align="center">14</td><td style="width: 14%;" align="center">15</td><td class="CalTodayDay" style="width: 14%;" align="center">16</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">17</td><td style="width: 14%;" align="center">18</td><td style="width: 14%;" align="center">19</td><td style="width: 14%;" align="center">20</td><td style="width: 14%;" align="center">21</td><td style="width: 14%;" align="center">22</td><td class="CalWeekendDay" style="width: 14%;" align="center">23</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">24</td><td style="width: 14%;" align="center">25</td><td style="width: 14%;" align="center">26</td><td style="width: 14%;" align="center">27</td><td style="width: 14%;" align="center">28</td><td style="width: 14%;" align="center">29</td><td class="CalWeekendDay" style="width: 14%;" align="center">30</td></tr><tr><td class="CalWeekendDay" style="width: 14%;" align="center">31</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">1</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">2</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">3</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">4</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">5</td><td class="CalOtherMonthDay" style="width: 14%;" align="center">6</td></tr>
</tbody></table>

		
<h3>公告</h3>
<div class="News">
	<!--img src="http://www.cnblogs.com/Files/dragon/Dragon.zip" width=300 height=225 border=0 -->
<br>
要对我的朋友们说抱歉了,因为去年转向从事SAP的技术,所以很少有精力写.NET的新文章和回答朋友们的问题了。希望以后还能慢慢再写一些!
<br>
被访问次数：
<br>


<a href="http://freelogs.com/stats/d/dragonluo/" target="_top"><img alt="Free Web Counter" src="index.php" align="middle" border="0" hspace="4" vspace="2"></a>
<br>

<br>
访客人数：
<br>
<a href="http://freelogs.com/stats/d/dragonluouser/" target="_top"><img alt="Free Web Counter" src="index_001.php" align="middle" border="0" hspace="4" vspace="2"></a>
<br><div id="profile_block"><a href="http://home.cnblogs.com/dragon/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/dragon/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/dragon/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/sema" target="_top">发短消息</a></div>
</div>

		

<div class="mySearch">
<h3 class="catListTitle">搜索</h3>
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
<div class="ad_side">
<ul style="margin-left: 0px;"><li>
<div>

<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 150px; position: relative; visibility: visible; width: 180px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 150px; position: relative; visibility: visible; width: 180px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame4" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_5.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="150" width="180"></iframe></ins></ins>
</div></li></ul>
</div>
<h3>常用链接</h3>
<ul>

		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl00_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyPosts.html">我的随笔</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl01_lnkLinkItem" href="http://home.cnblogs.com/dragon/">我的空间</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl02_lnkLinkItem" href="http://space.cnblogs.com/msg/recent">我的短信</a></li>
	
		<li><a id="SingleColumn1_ctl03_rptMainLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyComments.html">我的评论</a></li>
	
<li><a id="itemListLink" onclick="this.blur();WarpClass('itemListLink', 'itemListLin_con');return false;" href="#">更多链接</a></li>
</ul>
<div id="itemListLin_con" style="display: none;">
<ul>
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl01_lnkLinkItem" title="我发表过评论的随笔" href="http://www.cnblogs.com/dragon/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/dragon/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/dragon/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn1_ctl03_repeaterLinks_ctl04_lnkLinkItem" href="http://www.cnblogs.com/dragon/tag/">我的标签</a></li>
	</ul>
</div>
<h3 class="catListTitle">我参与的团队</h3>
<div class="RecentComment">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1__1daaec0_TeamList_ctl01_lnkTeam" href="http://team.cnblogs.com/SHDotNetClub/">上海.NET俱乐部(0/0)</a>
			</li>
		
			<li>
				<a id="SingleColumn1__1daaec0_TeamList_ctl02_lnkTeam" href="http://team.cnblogs.com/BluePrint/">BluePrint翻译团队(0/0)</a>
			</li>
		
			</ul>
		
</div>


<h3 class="catListTitle">我的标签</h3>
<div id="MyTag">
<ul>
<li><a href="http://www.cnblogs.com/dragon/tag/%e5%a4%9a%e6%ac%a1%e8%a7%a6%e5%8f%91/">多次触发</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/FileSystemWatcher/">FileSystemWatcher</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/Timer/">Timer</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/Multipul/">Multipul</a>(1)</li><li><a href="http://www.cnblogs.com/dragon/tag/log4net/">log4net</a>(1)</li>
</ul>
</div>
		<h3>随笔分类<span style="font-size: 11px; font-weight: normal;">(20)</span></h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/category/11625.html">技术研究(17)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to 技术研究(17)" href="http://www.cnblogs.com/dragon/category/11625.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/category/11624.html">生活手记</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to 生活手记" href="http://www.cnblogs.com/dragon/category/11624.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/dragon/category/11651.html">似水流年(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to 似水流年(3)" href="http://www.cnblogs.com/dragon/category/11651.html/rss">(rss)</a></li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/dragon/category/11626.html">小说收藏</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to 小说收藏" href="http://www.cnblogs.com/dragon/category/11626.html/rss">(rss)</a></li>
			
				</ul>
			
	
		<h3>随笔档案<span style="font-size: 11px; font-weight: normal;">(20)</span></h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/archive/2008/07.html">2008年7月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/archive/2007/06.html">2007年6月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/dragon/archive/2006/09.html">2006年9月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/dragon/archive/2006/05.html">2006年5月 (2)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/dragon/archive/2005/07.html">2005年7月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/dragon/archive/2005/06.html">2005年6月 (1)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/dragon/archive/2005/04.html">2005年4月 (2)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/dragon/archive/2005/03.html">2005年3月 (6)</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/dragon/archive/2004/10.html">2004年10月 (5)</a> </li>
			
				</ul>
			
	
		<h3>相册</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/dragon/gallery/47395.html">123</a> </li>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://www.cnblogs.com/dragon/gallery/28706.html">life</a> </li>
			
				</ul>
			
	
		<h3>技术站点</h3>
		
				<ul>
			
				</ul>
			
	
		<h3>朋友的blog</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl04_LinkList_ctl01_Link" href="http://www.cnblogs.com/debbie">Debbie's blog </a> </li>
			
				</ul>
			
	
		<h3>收藏的站点</h3>
		
				<ul>
			
				<li><a id="SingleColumn1_Categories_CatList_ctl05_LinkList_ctl01_Link" href="http://dragonluo.spaces.live.com/" target="_top">我的生活</a> </li>
			<li style="margin-top: 2px;">记述我的工作及生活感受</li>
				</ul>
			
	

<h3>积分与排名</h3>
<ul>
	<li>
		积分 -
		242081
	</li><li>
		排名 -
		213
	</li>
</ul>

<h3 class="catListTitle">最新评论
	<a id="SingleColumn1__a835fb_RSSHyperlink1" href="http://www.cnblogs.com/dragon/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3>
<div class="RecentComment" id="RecentComments">
	
			<ul>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/04/11/135617.html#1718048">1.&nbsp;Re:在C#中利用自动化模型操纵Word</a>
			</li>
			<li style="">
				谢谢
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--吉文</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1700959">2.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				写得很好
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--eking</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694547">3.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				地方告诉对方公司的股份大幅vxcv
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694545">4.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				和很多黄金时代刻录机撒旦克里夫回家啊都是
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			<li style="">
				<a id="SingleColumn1__a835fb_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html#1694543">5.&nbsp;Re:自动向网页Post信息并提取返回的信息</a>
			</li>
			<li style="">
				抽刀断水水更流
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--12334534563465</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">阅读排行榜</h3>
<div class="RecentComment" id="TopViewPosts"> 
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/08/394078.html">1.&nbsp;深入浅出之正则表达式（一）(73020)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html">2.&nbsp;Log4Net使用指南(38494)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/09/394923.html">3.&nbsp;深入浅出之正则表达式（二）(26009)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html">4.&nbsp;自动向网页Post信息并提取返回的信息(14598)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/25/125533.html">5.&nbsp;VS.NET 2003集成环境插件开发指南(一)----操纵菜单(12639)</a>
			</li>
		
			</ul>
		
</div>

<h3 class="catListTitle">评论排行榜</h3>
<div class="RecentComment" id="TopCommentsPosts">
	
			<ul style="">
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/03/24/124254.html">1.&nbsp;Log4Net使用指南(89)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/08/394078.html">2.&nbsp;深入浅出之正则表达式（一）(54)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/06/15/174946.html">3.&nbsp;自动向网页Post信息并提取返回的信息(45)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2005/07/29/203189.html">4.&nbsp;在.NET环境中实现每日构建(Daily Build)--NAnt篇(38)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl09_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/dragon/archive/2006/05/09/394923.html">5.&nbsp;深入浅出之正则表达式（二）(32)</a>
			</li>
		
			</ul>
		
</div>
		
</div>
<div class="footer">

<p id="footer">
	Powered by: 
	<br>
	
	<a id="Footer1_Hyperlink3" name="Hyperlink1" href="http://www.cnblogs.com/" style="font-family: Verdana; font-size: 12px;">博客园</a>
	<br>
	Copyright © sema
</p>
</div>
    </form>
	
	
      
    
    
    
</body></html>
